If somebody can't do the exercise in their language of choice I have doubts about their competency in general. That seems different than asking arbitrary questions about specific language constructs.
If somebody can't do the exercise in their language of choice I have doubts about their competency in general. That seems different than asking arbitrary questions about specific language constructs.
They then proceed to use the language that was listed on the job posting, that they're clearly barely familiar with, to answer the question. Typically incorrectly.
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
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