2 ms·
I find this kind of question quite interesting in a somewhat unfair way. When something highly unexpected is presented, it really makes the candidate think out
by kccqzy 9y ago
I find this kind of question quite interesting in a somewhat unfair way. When something highly unexpected is presented, it really makes the candidate think out of the box. I can for example immediately think of several weird cases (overloaded operators/implementation of == or &&, another thread trying to increment it at the same time, strange type coercion rules, running inside a debugger etc) and to me, as an interviewer if I heard of a novel answer, this shows the creativity of the candidate.
But again I concede that this is totally unfair. Not everyone can immediately think out of the box at a moment's notice, especially during an interview which can be quite stressful. I certainly wouldn't place a lot of weight on those kind of questions; if the candidate surprised me with a novel answer, that would be the icing on the cake.
- geofft 9y ago> Not everyone can immediately think out of the box at a moment's notice, especially during an interview which can be quite stressful. Yup. This is sometimes a skill you want to test for - I have had a job where I would occasionally get paged at 3 AM to diagnose and fix novel problems in parts of infrastructure that I hadn't previously interacted with, for a high-frequency trading company where every minute of downtime had a financial impact. If you're hiring for that sort of thing, asking people if they can figure out stupid problems under time pressure and in a high-stress situation is exactly what you want to select for. If you're hiring someone to sit at their desk, write code, and go home after 8 hours, where "time-sensitive" problems have their response time is measured in days and not minutes and where there's plenty of time to Google for similar situations or try to reproduce the problem in a test environment, responding to weird questions on short notice with someone staring at you until you figure it out is a much less relevant skill. And I think most tech jobs fall in this category. Ideally, give them interview problems where they can go home, get some sleep, drink some tea, and figure out the answer in the morning. I've done a bunch of hero work on O(minute) timeframes, but my actual quality work has always taken days of thinking about the problem quietly.