by Udik · 11y ago · 0 comments
Also, the code is a bit muddy to me, but it seems (please tell me if I'm wrong) that the proposed solution requires being able to move two separate pointers on the chequerboard. If this is true, note that the specification of the problem is
"A chequerboard is hidden from us. A player (note: a single player) moves the chequer one square and calls out the move".
For how the problem is stated, there is no chance of moving two separate pointers along the chequerboard. The list of moves could be streaming through a web service, so in order for the tortoise to move at half the speed of the hare, we'd need to remember in an array all the moves that separate the tortoise from the hare, making it for a solution equivalent to the plain and readable one.
So it sounds like the zealous overengineering somehow (in fact through the usage of iterators) brought the interviewee to a solution that's plain wrong with respect to the given requirements. Where did I see that before? :)
It would be interesting to see if The Carpenter threw the whole thing out, or simply wrote a memoizing cycle detector in place of the last step. That could lead to a discussion about separation of concerns.
However, the fact that Christine couldn't even tell that the code was not working reinforces the correctness of her hunch: hypnotized by the unreadable code, neither her or the interviewee could see clearly that it wasn't fit for the intended purpose. And this is clearly a serious issue.
I agree that an interview should be more interactive than that, but one could easily blame the Carpenter for having transformed the answer to a simple question into a long monologue that lead nowhere. I can't help but feeling he got what he deserved, although I'm afraid that, in the real world, his confidence and command of technicalities would have gained him the job on the spot.