Thursday 24 October 2013

Interview Experience - PART II

Questions in C

1. What are static variables and static functions?
2. How to use a function in a file which is defined as a static function in a different file? (Function pointer)
3. A header file is written and included in two .c files. What is the problem in it? - Multiple definition of functions.
How can this be resolved?? (There are no problems when stdio.h is included multiple times. How is that possible?)
4. Given a string, find the number of occurrences of a sub string and print only those words that contain this sub string.
5. Write a program for pre-order traversal of a binary tree using recursion.
6. write a program for binary search in a tree.
7. Assign all the alternate bits of an unsigned short to an unsigned char.
8. What is the different stages of compilation of a c file?
9. What is the content of a .o file?
10. How to pass a command line argument to change a macro?
11. What is the difference between a MACRO and inline function?

Questions in LINUX

1. Write a simple Makefile
2. What all files will be packed in run time rpm, devel rpm.
3. How to add run time rpm as dependency to devel rpm in rpm spec file?
4. Why and when use cross compiler?
5. What is the difference between printf and write? (between library functions and system calls)

No comments:

Post a Comment