My New Favorite Interview Question
I interview a fair number of geeks every year and usually spend my alotted time going over one programming challenge. Lately I’ve been looking for a new one that was simple, but still big enough to give me a glimpse into their thinking. I think I’ve found it.
Why I Like This
I really like this question because:
- A good solution involves recursion but you could approach it in multiple ways.
- The seemingly simple Array throws a monkey-wrench into the whole thing.
- It tests their ability to follow written instructions.
- It should give an idea of how willing they are to ask questions.
- It’s small, but with 3 separate, but connected, things to handle should be enough to give insight into how they work through things.
- In my experience you’ll spend ~40 minutes on this regardless of experience level. I’ve only had one person do it in 5. If folks finish a little early I try and find out what kind of job would make them happy.
The Question
You’re presented with the following YAML file which you need to convert to a useful data structure, but for whatever reason you don’t have a YAML library. You do however, have something that has converted it into a tree of nodes.