Hacker News new | past | comments | ask | show | jobs | submit login

The last time I was interviewed by phone at Amazon, I was asked to write a binary tree to a file. Time given: 30 minutes. Does that count as a puzzle? Did lot's on exercises on binary trees before but was not prepared for that question.



Nah, that sounds pretty simple - you just need to know how to walk a binary tree (basic knowledge) and how to write a string to a file (even more basic knowledge) - provided binary tree stores strings (and with right serializer, everything stores strings). Unless I am missing something. Don't think this qualifies as a puzzle. Puzzle would be something that requires non-trivial knowledge or exceptional insight to solve.


OK then do it on the phone with the interviewer looking at you as you're typing and your brain has suddenly blanked. I've been coding since I was 9 years old, have a massive (relatively) side project with a couple hundred users, have shipped multiple projects in multiple jobs, and I know what a binary tree is and how to traverse one, but I'll be damned if I can figure out how to do it under those conditions. I absolutely hate interview questions where they make you code on the spot. Just look at my Github, I swear I wrote that code.


That's not a puzzle, though. A puzzle would be something barely related to computer science, like "How can I find which ball out of 9 is heavier weighing them twice on a two-sided scale?"


I think this is a bit pedant. It's fairly common for developers to call questions like these puzzles.


Basic algorithmic knowledge questions are not puzzles, and whoever is calling them that is wrong. Those questions still can be stressful, especially for people that don't do well in interview environment, but puzzle is something else. Puzzle is something that requires some non-trivial insight or trick to solve, usually one that the person has no experience with and it is not obvious even for a person with the knowledge of the basics. That's why they are puzzles - they are "puzzling", which the dictionary defines as "confusing" or "baffling".


I forgot to mention the key part of the task. The key was to constitute the tree back by reading it from the file. The writing part is trivial, the reconstitution part is not. Try it. While not impossible for a decent programmer half an hour is not sufficient who does not deal with binary trees ona daily basis.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: