Back in the day my grandma was testing my foreign vocabulary. She had to learn that I knew the translations, just not at the speed she was used to.
Not every brain works in the same way.
Back in the day my grandma was testing my foreign vocabulary. She had to learn that I knew the translations, just not at the speed she was used to.
Not every brain works in the same way.
If I ask to determine whether an array contains two numbers that add to zero, a competent engineer should be able to give the naive answer -- a doubly nested loop -- in ten seconds, or at most a minute. If someone takes a lot of time to give me any answer at all, it's a concern.
But seriously, giving programming problems like these to a PhD is probably going to scare the hell out of them, not because they think it's hard, but because they'll find it indicative of the work they'll be doing if they get and accept the position. Hopefully such faker filter questions are followed up with ones with real technical meat.
But this question lets me learn a lot about the candidate:
- How quickly did they come up with any working solution?
- How long did it take them to reach the optimal solution?
- Do they know time complexity?
- If they're using Java, did they use a plain array or ArrayList? Do they understand boxing and performance?
- Do they understand the range of an integer? I'd tell them that the array represents the population of the earth every year from 1900 till today, and see if they realise that they need a 64-bit integer.
A competent engineer or just one who's practiced HackerRank questions and mastered the cliche choreography of the SV interview format?
"Think out loud! We want to know how you think! Ask clarifying questions! Start with the naive solution! But oh also please do all of these things within an arbitrary time restriction known only by me if you want to impress me."