I had a coding onsite interview at microsoft few months back. I have 10 yoe.. The question was pretty easy, merging 2 linked lists, i solved the problem and wrote pseudocode. The interviewer however was insisting i write a production level code. I added test cases and exception handling, but he still looked unhappy. I did not get selected. What does production level code mean?
Write code which compiles and runs. Don’t write pseudo code.
This is what he was expecting^^
I thought the first thing they say in prep books is to not use pseudo code?
Did you add null check, empty linked list check, same number case handling, and the trick part at the end where you are left with only one list?
I did add null check and ran thru few cases. He initally said write the logic, i wrote the logic, then after that i wrote the code in c++,
You should write a code that doesn’t have any syntax errors in it.
On a white board?
Did you use recursion? Not a good idea if you final solution was a recursive one.
That person is a jackass.
Well, but how do i handle that in future ?
Leave the room immediately. Or ask whether the company’s policy is to write production code on whiteboard and test it there as well.