3 ms·
It's funny, I've heard "reverse a binary tree" as the canonical coding interview algorithm question for over a decade and I've never stopped to think about what
by tfehring 6y ago
It's funny, I've heard "reverse a binary tree" as the canonical coding interview algorithm question for over a decade and I've never stopped to think about what it actually involves. But I just Googled it and it seems like you're right...and yeah I feel like if you know how recursion works and you know what a decision tree is, it seems like a pretty trivial question.
- UK-Al05 6y agoIt's a common joke interview question. I don't think anyone has acutally asked it? I find high end jobs tend to ask some form of problem that can be tackled using dynamic programming techniques. Maybe couple of easier ones in the first interview. I agree with most people. I never use these skills in the job. I think they're a intelligence test in disguise.
- tfehring 6y agoOh, if it's just a joke that went over my head then that totally makes sense! Though in fairness there are apparently-serious interview questions that are even easier (e.g. FizzBuzz, though I don't think anyone asks that anymore either) and I've been asked interview questions that aren't much harder. I mostly agree with your impression, though even after adjusting for intelligence I bet there's a positive correlation between knowing how B-trees work and, say, having a good intuition for how to index a database.
- pokler 6y agoFor me, the 'reverse a binary tree' question goes back to the creator of Homebrew being rejected from Google for not being able to answer that question: https://twitter.com/mxcl/status/608682016205344768?lang=en https://twitter.com/mxcl/status/608682016205344768?lang=en