3 ms·
When I was interviewing devs, I rarely asked anyone to whiteboard. Instead, I came in with around a dozen small C++ apps. Id tell the candidate that unless told
by hermitdev 7y ago
When I was interviewing devs, I rarely asked anyone to whiteboard. Instead, I came in with around a dozen small C++ apps. Id tell the candidate that unless told otherwise, the code compiles and links with default compiler settings (g++).
Id ask them to tell me the output (all of them would print some result). The examples were pretty small, most less than 20 lines, but each exposed understanding of the language. One they told me their output, always had them explain their reasoning and justification.
One of my favorites was:
if (~false == true)
cout << "true";
else
cout << "false";
This little gem exposes understanding of a few operators, as well a bit of the type system and automatic type conversions. I have had some that didnt even know the bitwise inverse operator.
I may have been a bit of a dock as an interviewer, but my goal was to get the candidate to say "I dont know". Wanted to make sure they wouldnt lie and try and bullshit. When I got the "I don't know", the followup was key: how,if, they would go about finding a solution. Being a dev isnt about knowing/memorizing everything, but effectively using research skills.
For the examples I provided that didnt compile, I always provided the error message(s), and then asked them to correct the program so it would compile.
Edit: formatting
- jbverschoor 7y agoMy response would be: Doesn’t matter what the output is.. fire the person who wrote that code. If that’s what your codebase looks like, good luck finding and keeping people. Also, yes bitops are nice and everything. But unless you’re creating games, or working on ffmpeg, you have no need for them except in certain fields to combine option for certain libraries