Saturday, September 20, 2014

Interview Questions : C Programming and Data Structures

1. State the use of 'Volatile'. What happens when cache is disabled in a system?
2. Program for reversal of linklist.
3. Difference between declaration and definition.
4. Explain pointer to const and constant pointer.
5. Tell me declaration of a function pointer for a function which takes no argument but returns a pointer to char.
6. Dynamically allocate double dim array.
7. Difference between k++; and ++k; in terms of efficiency.
8. How to find sizeof of an unknown structure without using sizeof operator. Assume that you only know the name of the struct not its components.
9. How to find or update 'n' th byte of any integer.
10.How to set 'n' bits of a number from 'p'th position.
11.How to find a 'n'th node from last node of a single linklist while traversing from root.
12.How to find whether two linklist merges or not, and also where they merge.
13.How to find whether there is a cycle in a linklist.
14.How to determine whether a system is Little Endian or Big Endian?
15.How to change Endianness of a number?
16.How to rotate 'n' bits of a number?
17.How to find whether a number is power of 2 or not?
18.Finding number of set bits in a number without a loop?
19.How to toggle 'n' bits of a number from 'p'th position.
20. Declare a function pointer which takes a pointer to an array and also returns a pointer to an array.
21. What are 'Variadic' functions?
22. How would you find pattern in a string.
23. Explain how compiler manages an Inline function? What is the difference between Inline and Macros?

No comments:

Post a Comment