11 ms·
What does any of that have to do with the question? This is a performance question. I'll accept readability/simplicity as an afterthought, but if you answer in
by raylu 13y ago
What does any of that have to do with the question? This is a performance question. I'll accept readability/simplicity as an afterthought, but if you answer in this manner you've missed the (quite clear) point of the question.
- city41 13y agoI disagree the point of the question is clear. I also strongly argue that questions like this are not productive and that most companies have completely broken dev interviews. I disagree because I've been in interviews where a question like this, and all questions asked for that matter, have a testing expectation to them. If a developer answers this question without considering test coverage and what that means, some companies see that as a sign of a dev who doesn't appreciate tests or have a full grasp of the entire lifecycle of development. "Trick questions" with hidden undertones are very common. Or is it a practicality question? I do not want to hire a dev who is concerned with squeezing every drop of performance out of function calls that make up 0.001% of the app's runtime. Is finding out the candidate is aware that sort+binary search is O(nlogn) versus O(n) of linear search really enabling you to find a quality candidate? Maybe, but probably not. We don't ask questions like this at all anymore. The bulk of our interview process is sitting down with the candidate and writing a small program with them, end to end. Not perfect either, but far more effective than ambiguous questions.