3 ms·
> If you have a big knowledge gap in something that's > - easy > - freely available > - relevent to your job > then that's pretty much entirely your fault a
by inetknght 6y ago
> If you have a big knowledge gap in something that's
> - easy
> - freely available
> - relevent to your job
> then that's pretty much entirely your fault and it has nothing to do with your educational background.
Sure. But reversing a binary tree isn't relevant to most modern software engineers. And when it does become relevant then, like you said, it's easy to learn (on the job).
> It's not even anything that advanced or difficult either.
No but it is something that gets "memorized" for a test (and therefore immediately forgotten afterward).
- mcguire 6y agoThe vast majority of people don't use algebra, yet it remains (was?) a requirement to graduate high school.
- thu2111 6y agoI don't fully get this argument. Trees are a very common thing to encounter in all sorts of programming and recursively walking them is also very common. I had to do it yesterday as part of writing some code to traverse a file system, nothing fancy. Although I've never asked or been asked it in interview context, reversing a binary tree specifically is probably just checking you understand how to write recursive functions. Binary, because variable number of child nodes would make the code longer and more complex for no good reason. Reverse, because that's the simplest operation you can do at each node. People in this thread are acting like tree processing is as exotic as theorem proving, and could never have anything imaginable to do with daily work, but every web page is literally a tree!
- BoorishBears 6y agoTime complexity often comes up in these problems too, so it's not enough to just know the requisite parts of the problem you need to have memorized specific approaches unless you plan on doing some theory crafting mid interview... And it's not like you can't find out of the applicant knows recursion and what a tree is without bringing in memorization, there's just some weird obsession with a very specific type of problem which happens to often involve memorization
- cutemonster 6y agoAgreed that tree algos are common, there's some in an app I'm building. And time complexity trade-offs too.
- vmladenov 6y agoI don’t understand why reversing a binary tree has become a favorite punching bag of the popular ire against programming interviews. It is an instance of the question: do you understand recursion from a discrete math perspective? I’ve never been asked this question, so I haven’t “memorized” it as you say, but if you want to flip the order of all the nodes in a binary tree, you’ll need to at least reverse the left and right subtrees at some point. The understanding recursion part is knowing that reversing the subtrees is the same operation as reversing the main tree. In that way, it’s similar to the recursive solution to the Tower of Hanoi.