Wednesday, March 5, 2008

C TECHNICAL INTERVIEW QUESTIONS

1.What does a static variable mean?
2.What is a pointer?
3.What is a structure?
4.What are the differences between structures and arrays?
5.What is a static identifier?
6.Where are the auto variables stored?
7.What is recursion?
8.In header files whether functions are declared or defined?
9.What are the differences between malloc() and calloc()?
10.What are macros? What are the advantages and disadvantages?
11.Difference between pass by reference and pass by value?
12.Where are the auto variables stored?
13.Where does global, static, local, register variables, free memory and C Program instructions get stored?
14.Difference between arrays and linked list?
15.What are enumerations?
16.Differentiate between a for loop and a while loop? What are it uses?
17.What are the different storage classes in C?
18.What is difference between Structure and Unions?
19.What the advantages of using Unions?
20.What are the advantages of using pointers in a program?
21.What is the difference between Strings and Arrays?
22.What is a far pointer? where do we use it?
23.How can a called function determine the number of arguments that have been passed
to it?
24.Which one is equivalent to multiplying by 2?
Left shifting a number by 1
Left shifting an unsigned int or char by 1?
25.What is the use of typedef?
26.What are register variables? What are the advantage of using register variables?
27.Out of fgets() and gets() which function is safe to use and why?
28.How would you obtain segment and offset addresses from a far address of a memory
location?
29.Are the expressions arr and *arr same for an array of integers?
30.What do the ‘c’ and ‘v’ in argc and argv stand for?
31.What is the similarity between a Structure, Union and enumeration?
32.Can a Structure contain a Pointer to itself?
33.How can we check whether the contents of two structure variables are same or not?
34.What is the difference between an enumeration and a set of pre-processor #
defines?
35.What are bit fields? What is the use of bit fields in a Structure declaration?
36.Which bit wise operator is suitable for checking whether a particular bit is on or
off?
37.Which bit wise operator is suitable for turning off a particular bit in a number?
38.Which bit wise operator is suitable for putting on a particular bit in a number?
39.Which bit wise operator is suitable for checking whether a particular bit is on or
off?
40.How would you dynamically allocate a one-dimensional and two-dimensional array of
integers ?
41.How can you increase the size of a dynamically allocated array?
42.How can you increase the size of a statically allocated array?
43.What is object file? How can you access object file?
44.How much maximum can you allocate in a single call to malloc()?
45.Write a function similar to printf()?

PROGRAMS:

*Write a program to compare two strings without using the strcmp() function.
*Write a program to concatenate two strings.
*Write a program to interchange 2 variables without using the third one.
*Write programs for String Reversal. The same for Palindrome check.
*Write a program to find the Factorial of a number.
*Write a program to generate the Fibonacci Series?
*Write a program which employs Recursion?
*Write a program which uses command line arguments.
*Write a program which uses functions like strcmp(), strcpy(), etc.

No comments: