Don't use questions involving eureka moments. They reveal nothing about the candidate.
Edit: It should be noted that this question was used for a long time at Google, Microsoft, and many other places. It's a terrible question.
Don't use questions involving eureka moments. They reveal nothing about the candidate.
Edit: It should be noted that this question was used for a long time at Google, Microsoft, and many other places. It's a terrible question.
Two-pass solution is obvious, just look at the final state. Once you are at that, the one-pass is a run-of-the-mill optimization of switching from accumulating and then processing the state to doing it all in parallel. The ability to recognize when this is doable is a good way to tell someone who's done it before (in some other context) from those who merely wrote a functional prototype of Tic-Tac-Toe in TurboPascal.
Not an exact definition, no. But if a question is exceedingly simple after one tiny bit of insight that doesn't require much analytical thinking to arrive at, that certainly falls into the category.
I hate this kind of problems.