Good C interview questions from the net... "What is K&R?" or "Harbison and Steele" 1) What does the word static mean? In which contexts would you use it? 2) What do you understand by function prototyping? 3) How do you prevent include files being included more than once? A colleague has suggested that it might be more apropriate to ask candidates about there data-structure knowledge because understanding the algorithms is much harder than improving one's C if one already has a smattering. >I like "Explain the following statement:" > char *x = "abcd" + 1; >This tends to eliminate a bunch of wannabes. These days, I would be tempted to ask for a comparison between C and C++, and for what purposes she would use one or the other. I'm not looking for any particular answer, I just want to know that the applicant is keeping up with current advances (or, at least, changes) in technology. I also wouldn't count an answer of "I've never had an opportunity to use C++" against the person (unless, of course, I'm looking for an experienced C++ programmer). But my next question would probably involve the use of C for object-oriented programming, if only to find out what "object-oriented" means to that person. I'd ask at least one question from each of the following categories: 1) data types 2) pointers, arrays, strings 3) statements (for, while, if-else, ... ) 4) functions (pass by value, reference, prototype declarations (why?), ...) 5) structs 6) scope rules 7) build issues (includes, modules, make, ... ) 8) performance / maintainability tradeoffs "Do you use gotos when you program?" If suspect answers anything but "it depends.." oppose to his view, demanding an explanation. The result should teach you something about his ability to make educated choices between design alternatives. How about "How would you print the rightmost 8 characters of the name of the current source file?" Why is the following code inefficient? #include #include char s[] = "abcdefghijklmnopqrstuvwxyz"; extern int check(char); /* returns 0 or 1 */ int i; for (i = 0; i < strlen(s); i++) { if (check(s[i])) { putchar(s[i]); } } 1. a->b = 5; 2. x ^= 1; 3. static char *f(int x, ...); 4. int (*f)(cat dog); 5. a = b ? c : d; 6. b = 3; x = (b++ * 3 * b) - (b / 2); printf("%d %d", x, b); 1. Read a text file, and accumulate the words in the file and the number of occurrences of each word. 2. Take queries, which for a given word, will respond with the number of occurrences of the word in the input file. Ask him/her to explain pointers.