I have taken some C and C++ interviews in India and I must say I am quite disappointed by the kind of questions Indian interviewers ask. They expect black-n-white answers to questions and wont accept any middle ground. They try to confuse you for even simple questions, unnecessarily trying to complicate simple concepts. I also fail to understand how they will judge someone as a good or bad programmer based on such questions.
On top I have had argument with atleast 3 interviewers because they asked me a question and then themselves were giving wrong answers to their own questions. Here are few samples of some really bad questions:
- "What is p in the following C statement: int const* p". The interviewer was hell bent on proving that p was a constant pointer to integer (you can clearly see its pointer to a const integer). I explained the difference but she wouldn't budge unless I explained her all possible expressions.
- Another guy asked if a pointer should be checked for NULL before deleting it. I told him that C++ standard guarantees that nothing wrong will happen on deleting a NULL pointer. He argued that its a standard coding practice to check for NULL and that C++ compilers are not reliable (in following c++ standard).
- Another guy asked me a question and then asked whether run-time error will occur or compile-time error. I argued that why would anyone write a code like that and I personally wouldn't write code like that. But he insisted that I choose between runtime or compile-time error.
- Another guy started asking me how to read command line parameters. I explained him that libC provides convenient faciltity to handle command line parameters. But this guy was hell bent in asking me the syntax of the library facilities. I told him to check libC manual and that it is impossible to remember the API details.
- Another guy asked me what will happen if for a singleton class, I remove the static qualifier for the instance pointer and instead just used a member variable which is a pointer to class. I said static getInstance method will throw error because static member functions cannot manipulate non-static member variables(in this case the instance pointer). He kept on insisting that I was wrong and that everything will work fine and kept pestering me to explain how. I didn't agree.
- A classic ridiculous question Indian interviewers ask is on sequence points where they would throw obscure expressions at you (p += ++p * p-- ;) which a programmer will never write and for which behavior is undefined and on top they expect you to come up with perfect answers.
Has anybody had similar interviewing experiences where you ran into argument with interviewer or were faced with ridiculous questions. Please share