Live data from Hacker News

I Don't Want to Hire You If You Can't Reverse a Binary Tree

thecodebarbarian.com

31–40 of 115 posts

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#32
I found the spirit of article a bit narrow-minded for all the reasons mentioned here already.

It did however make me think of an almost opposite activity for the next time I interview someone:

Pick a difficult trick question (like Binary Tree reversal but harder/arcane) that neither of us can solve, and spend some time working on the problem together with the candidate.

After all, solving problems together (directly, or indirectly) is what we'll be doing day to day.

This might not be a good idea, but I'll definitely try it out once and find out.

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#33
post #11

Couldn't disagree more with the author. How many developers need to implement their own binary-tree? This is why code-bases become convoluted with six different implementations of standard data structures.

That's missing the point of the article. The author says that the candidate's thought process behind arriving at the solution provides insight into the candidate's skill. There's no reason to implement your own binary tree, but knowing how to devise algorithms to accomplish a given task is a necessary competency.

But surely an example question with only 2 right answers doesn't give you a good cross-section of the person's understanding. What if they understand the reverse relationship but choose the more concise option for many other reasons. The desire to understand a developer's thinking is good. This question does not well accomplish that goal.

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#35

Sigh. If you hire using know it or not questions about binary trees, then you finally get to hire people who can study up and answer that specific question in a manner Pavlov would approve of. That does not mean the candidate will be able to design clean APIs, know how best work with different types of data, or even how to troubleshoot existing code. Still, pat yourself on the back, I mean, your entire team can answe…

when i interviewed at yahoo as a full stack web developer, i was dismissed after getting the a single tree related question wrong. was a trivial 'trick' question about balancing certain types of trees, similar to this article. having been through that, i wouldn't have wanted to work there based on that being the bar of entry.

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#36
post #11

Couldn't disagree more with the author. How many developers need to implement their own binary-tree? This is why code-bases become convoluted with six different implementations of standard data structures.

That's missing the point of the article. The author says that the candidate's thought process behind arriving at the solution provides insight into the candidate's skill. There's no reason to implement your own binary tree, but knowing how to devise algorithms to accomplish a given task is a necessary competency.

Reversing a binary search tree is a binary (pun intended) answer: you either know how to do it because you learned it in college/read Cracking the Coding Interview, or you don't.

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#37

> "Just about everything you do in your programming career will be related to trees." I've never knowingly used a tree structure since college, everything is abstracted away from me. Now whether this is a good thing or a bad thing remains to be seen, but it has not been a problem yet.

Very good point. If you write C++, std::set and std::map use trees. And most people who use them don't know that and 99% of the time, that's OK.

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#38
post #28

Couldn't disagree more with the author. How many developers need to implement their own binary-tree? This is why code-bases become convoluted with six different implementations of standard data structures.

Well, to pick on Valeri, this is simply wrong Trees are the single most important data structure in computer science. Just about everything you do in your programming career will be related to trees. Trees are a horrid data structure for any modern processor. Pointer chasing thrashes caches. The actual most important data structure is a hashmap. The same speed in theory, much faster in practice.

How do you represent hierarchical data in a single hashmap?

Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree

#40
Invert. Invert a binary tree. Max never gave any details on what that meant exactly, but the question is not necessarily the same as reversing a tree.

Also, way to back up your claim that Homebrew is bad software by pointing to another guy not explaining anything about Homebrew but just dogpiling on Howell again.

Post reply on HN