Earlier quoted context omitted.
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.
I Don't Want to Hire You If You Can't Reverse a Binary Tree
81–90 of 115 posts
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#82Dredging this comment, because while this article is not about whiteboard coding, it would inevitably be mentioned.
I think many people, including many interviewers, completely miss the point of whiteboard coding. I think this article needs to be shared: http://darrenkopp.com/posts/2013/04/19/Post-mortem-of-my-fai...
The key point is that the interviewer is, or should be, a friend. He should not be out to stump a person or out to get him; he should genuinely want a person to succeed at the interview. If not, it's better just to reject the person outright. White board coding should be seen as a way for person to engage in collaborative problem solving, which is something that we do on a daily basis. Can you explain your thought process? Can you admit your stuck? Can you have an intelligent discussion about your solution, listen to feedback, etc. The problem should be challenging and relevant, but it should not be a test of coding skill.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#83Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#84Earlier quoted context omitted.
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.
> knowing how to devise algorithms to accomplish a given task is a necessary competency Agreed. Why not use a realistic problem and setting?
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#85Earlier quoted context omitted.
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.
Everything in programming is trees. If you write a program that calls functions, that call other functions, that's a tree.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#86Earlier quoted context omitted.
How is that a "trick" question? I never been asked that in an interview question and had the correct solution in my head in just a few seconds for the very reason he gives -- experienced programmers can map their intuition to code. This is certainly a skill that takes time to develop, and if you're concerned with hiring the best, don't you think this is a decent heuristic to throw in with a bunch of others ? Programm…
> Programmers are so sensitive, and honestly all your "sighing" is obnoxious. Perhaps instead of being annoyed, you could try to understand why people are sighing. Many of them will have lost out on a job they were qualified to do because of bullshit interviewing practices like this one. It has a real effect on them. It's not a trivial issue. > You don't have it all figured out. No one here has claimed to have it all…
I'm somehow a poor boss to work for because I told the OP his sighing is obnoxious? It is. It feigns authority and condescends the entire post for being so dumb he has to sigh at it. While you might have your feelings hurt, have you considered the feelings of the guy who took the time to write up an entire post explaining his position in a rather civil & straightforward manner? Have you considered the person at the other end of the interview table?
> No one here has claimed to have it all figured out
> whiteboard interviews are terrible, alienating, unrealistic, antiquated tools for hiring.
Hm...
And ya man, I'm not a programmer but I figured out his coding puzzle in a few seconds.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#87Earlier quoted context omitted.
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?
E.g., turn {"foo": {"bar": "moop"}} into {"foo-bar": "moop"}. This also requires writing accessor fns, but it might be worth it, depending.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#88Couldn'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.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#89I lost him at: "I think homebrew is an awful piece of software that should never be used by anyone."
> I just couldn't resist a chance to take a snipe at homebrew, because I've spent more time than I care to admit sorting through the mess junior devs, designers, and non-technical people make of their dev machines with homebrew and when it comes time to upgrade everything inevitably goes horribly wrong.
The comment implies that real developers do not use Homebrew.
Re: I Don't Want to Hire You If You Can't Reverse a Binary Tree
#90> "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.
Have you ever stored a dictionary inside a dictionary? (e.g. something like the JSON: {foo : {bar : "baz"}} That's a tree.
The point being that hierarchical structures in programming languages abstract away from the underlying representation, and you can use them without knowing the details. (Though you should probably know anyway, so you understand your Big-O tradeoffs.)