4 ms·
I consider myself a proficient developer, however, in situations where I'm required to solve an obscure puzzle while someone is staring at me, generally makes m
by blparker 14y ago
I consider myself a proficient developer, however, in situations where I'm required to solve an obscure puzzle while someone is staring at me, generally makes me uncomfortable...no matter how easy the question. I interviewed for an internship position at Microsoft, where I was required to write some bizarre code on graph paper while the interviewer literally stood over my shoulder. Horribly uncomfortable, I barely made any progress, and was subsequently denied a position (obviously). After the interview, I went home and solved the question in a matter of minutes, wrote the code, optimized, and fully tested it. While I choked during the interview, I saw fellow classmates fly off to Redmond...classmates that I knew weren't better developers than I was, simply because I had worked with many of them on projects several times. That's when I knew this whole puzzle interview stuff was nonsense.
- jdmichal 14y agoI have a similar story with Microsoft when I interviewed with them my senior year also. I feel like I nailed everything except for the puzzles, and also got denied. My favorite one I "failed" on was: Given a node of a linked list, delete that node. The expected answer: Copy the next node's contents into the given node. Then delete the next node. Just simply never occurred to me to use a memory copy in a linked list. And this is despite the fact that I could immediately reason about the solution he gave me and point out a flaw in it (deleting the last node is impossible).
- boomzilla 14y agobut that is not a puzzle, it's real code if you don't access to a collection library
- jdmichal 14y agoNo, it's a puzzle for two reasons: 1. It's not a normal operation for a linked list. A normal linked list will expose operations to deal with items, not nodes. 2. There was an expected answer, and that answer was something other than the normal linked list delete operation of "traverse the list to find the node containing the item, while also keeping a trailing pointer to the previous item so that you can remove that item's node." Even if you are exposing nodes, and you do implement the given operation, then TheCoelacanth is absolutely correct that that operation just invalidated all references to the node after the one you thought you had just deleted, but not any references to the node you thought you had deleted. (Though those references are now pointing to a different data instance.)
- TheCoelacanth 14y agoIn addition to not being able to delete the last node, it also invalidates any pointers to the node after the one you're deleting.
- jdmichal 14y agoGreat point, and not something I had thought of. Just makes the "expected" solution even more odd... If you're exposing nodes enough to get an operation to delete a particular node with no context, then the given solution just invalidated a completely different node, but not the one you asked it to delete. No, the one you asked it to delete is still valid, just with different data associated.
- thejsjunky 14y agoAssuming (for arguments sake) out of everyone who applied you where the most ideal. In that case since you were not hired, either you or the people responsible for hiring made one or several mistakes. Most likely it was multiple mistakes on both sides. None of those mistakes were "ask a potential hire to do a simple demonstration of ability". Instead it was mistakes (on your part) like getting nervous and choking (something everyone does)...and mistakes on their part like not making the candidate feel relaxed, not providing enough guidance, and placing too much importance on one aspect of the interview...etc