4 ms·
Replying fast is a personality aspect. Back in the day my grandma was testing my foreign vocabulary. She had to learn that I knew the translations, just not at
by MrQuincle 9y ago
Replying fast is a personality aspect.
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.
- kartickv 9y agoI didn't say I want quick but wrong answers. I said I prefer a quick but inefficient solution to a problem, as a starting point. 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.
- seanmcdirmid 9y agoSort the array by absolute value, and then a check to see if two adjacent values are a negative/positive pair? 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.
- kartickv 9y agoIf the candidate does great, I'd definitely move on to more complex problems. 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.
- seanmcdirmid 9y agoAs for the last point, would you expect them to tell you it's impossible for populations to go negative?
- kartickv 9y agoNo, they should be able to make that common-sense assumption, and you need a 64-bit integer in either case.
- bogomipz 9y ago>"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." 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."