7 ms·
What is over engineered about his design ? It's actually well designed.
by thewarrior 12y ago
What is over engineered about his design ?
It's actually well designed.
- Ronsenshi 12y agoIt certainly is marvelously designed, not too amazing considering that Carpenter knew that it is one of the possible questions and he prepared his answer beforehand. Anyway, judging by the provided code, Carpenter should have done only basic alteration to the original code in the marked spots (// ???) which should have been enough for the interviewer, so that they might have moved on to the next question if there was one: > Christine looked at the solution on the board, frowned, and glanced at the clock on the wall. “Well, where has the time gone?”
- thewarrior 12y agoIf this happened in real life it would be frikkin awesome. The interviewer would be flabbergasted. There are a couple of other blog posts in this genre : http://blogs.msdn.com/b/ericlippert/archive/2011/02/14/what-would-feynman-do.aspx http://blogs.msdn.com/b/ericlippert/archive/2011/02/14/what-... http://vk.com/note736369_9773341 http://vk.com/note736369_9773341
- madeofpalk 12y agoAnother interpretation would be the candidate wasted all their time over engineering when a quicker solution would have done just fine. No wonder he never heard back.
- nilkn 12y agoYou'd be concerned that he tried to show off in a problem that was clearly highly contrived for the purposes of an interview? Well, I'd be concerned too. But just ending the interview process immediately is incredibly naive. If you see a candidate do something like this, your reaction is probably a mixture of (1) being impressed; (2) being wary that they're always going to be like this. So what do you do? You ask them about (2). But of course, that's not going to happen in this example, because the company is implied to have an incredibly rigid interview process which cannot be modified or adapted at all on the spot.
- madeofpalk 12y agoThe interviewer ran out of time - there was no choice but to end immediately, so you would have to either invite them back or call them later. eh. too much effort. Lets just hire the other guy.
- Ronsenshi 12y agoYeah, I imagine that would be quite weird.
- batiste 12y agoI would just have used a position hash map and be done with the problem in 30 seconds. His solution is definitely heavily on the over-engineered side of things. If somebody would pull something like the author in a interview, I would surely be impressed but it would be a read flag if it is really the way it handle simple problems like this on a daily basis.
- rtpg 12y agothere is the detail that if the interviewer wants it to be a constant-space mechanism, that you'll want to use the linked-loop cycle detection algorithm
- Udik 12y agoThe interviewer requires for a solution in finite time and space, and explicitly says that the size of the chequerboard is unknown but finite. The constant space requirement is totally made up by the interviewee. 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? :)
- picks_at_nits 12y agoThis is why a more interactive interview is useful. Christine could ask politely, “How would this work if you were given a streaming web service, instead of an iterator that you could restart? What would you change?” 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.