3 ms·
It could potentially be a pretty good interview question to weed out those who have spent the last 6 months memorizing algorithms. Realistically, anyone with p
by marginalia_nu 5y ago
It could potentially be a pretty good interview question to weed out those who have spent the last 6 months memorizing algorithms.
Realistically, anyone with programming experience would immediately question the premise of being asked to implement a binary search on a whiteboard because realistically the only way anyone will succeed is by having memorized an implementation.
- anonymoushn 5y agoI don't think this is an especially great question, but I worked at one company that asked this question and most people who got it right did not seem to have an implementation memorized. I say this because they got it right only after writing a buggy version and fixing some bugs. Another company was in the habit of asking a different question that gets to the heart of the matter of "Can you think with invariants?" but is not nearly as tricky as binary search. That seemed better to me.
- mannykannot 5y agoIt is a very useful question if you do not simply check whether the result is correct, but instead use it as a way to evaluate the candidate's problem-solving skills.