function reverse(t) {
var tmp = t.left;
t.left = reverse(t.right);
t.right = reverse(tmp);
return t;
}I Don't Want to Hire You If You Can't Reverse a Binary Tree
41–50 of 115 posts
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#42If your software team works on code with lots of binary trees, interview questions about them makes a ton of sense.
If your software team is making a website that just displays stuff from databases and web services, interview questions about binary trees makes no sense at all.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#43> "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.
{foo : {bar : "baz"}}
That's a tree.Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#44Sigh. 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
#45Sigh. 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.
a. dodged a bullet b. should basically do the exact opposite of every part of their hiring practices
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#46The sizable problem with this statement is that it is using a solution to pigeonhole a person. It takes a bit of audacious hubris, something Torvalds (an extraordinary engineer no doubt) is known for, to paint an entire person and their capacity and skill into a singular and simple quote.
Here's a novel idea: sometimes a person is a good programmer and sometimes they're a bad programmer. There's definitely a skill level that people fall into, but these aren't neat lines delineated with tired generalisms about "worrying about code" versus worrying about "data structures". Put your question into an interview and get different people to ask it and sure pick the people who were able to get a better solution. Hopefully you're asking more than one question. That's totally OK, but please don't attribute someone's performance at one question or assume that you've mastered everything it takes to know to paint someone as a "bad programmer" from one interview loop[0] or performance with their performance for that one question.
Sometimes it's obvious someone has no idea what they're doing and you can tell that from a question, but even in that case they could become better. There might be a weakness in a fundamental area they need to learn and sure you don't want to hire them until they do, but that doesn't make them a "bad programmer". All it is is a specific problem that the candidate should recognize and improve on to up their skill. They shouldn't walk away from your massive ego rethinking their career as you puff your chess out and write a haughty blog post about what you think about people and their skills.
[0] http://steve-yegge.blogspot.com/2006/03/truth-about-intervie...
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#47Couldn'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.
It's not 100% false that to use a library effectively you have to be able to write it.
That's a blanket statement. If we find one exception to this rule, then we can say that it's 100% false (since its truthfulness is binary -- it's either true or false).
To find one exception, we only need to find a single "good" piece of software whose author can't write 100% of the dependencies, including: (probably) C/C++ compilers, FS drivers, low-level network libraries, and the widely-used monster that is SSH.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#48https://medium.com/@kwindla/hiring-software-engineers-98498c...
(This is also on HN/new right now.)
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#49Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#50> Trees are the single most important data structure in computer science. And yet I've never professionally had to reverse one or know if they are symmetrical.