Re:My startup failed, then I found out I was unemployable
by tfehring on Tuesday April 13, 2021 @02:07PM
(#26796544)
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.
Re:My startup failed, then I found out I was unemployable
by UK-Al05 on Tuesday April 13, 2021 @03:33PM
(#26797868)
It'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.
Re:My startup failed, then I found out I was unemployable
by tfehring on Tuesday April 13, 2021 @04:42PM
(#26798986)
Oh, 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.
Re:My startup failed, then I found out I was unemployable
by pokler on Tuesday April 13, 2021 @04:34PM
(#26798888)
For 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
Re:My startup failed, then I found out I was unemployable
by Joker_vD on Tuesday April 13, 2021 @02:23PM
(#26796762)
Why would you even want to reverse a binary tree in the first place? Simply traverse it backwards, it's just as fast.
Re:My startup failed, then I found out I was unemployable
by CheezeIt on Tuesday April 13, 2021 @03:41PM
(#26797999)
Maybe you’re passing it to some other function that doesn’t do that, or you don’t want to add some ordering flag to the datatype because that complicates things.
But the purpose of the question of course is to be an easy question showing basic competency in recursion and pointer usage.
I don't really get why "reversing a binary tree" seem to be used as an example of what's wrong with hiring. I will say, though, that if someone said "how do you reverse a binary tree?" I would have asked the follow up question: "what do you mean by that?". If asking that would be used against me, sure, that's bad hiring.
But if the answer is: "swap all the left and right nodes in a binary tree", then... isn't that pretty basic programming?