Hacker News new | ask | show | jobs
by JamilD 3713 days ago
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.

4 comments

So this article leads off with @mxcl's tweet about google not offering him a job because he wasn't able to reverse a binary tree on a whiteboard.

I don't think that being able to describe an algorithm you haven't had to implement in more than decade (at least, that would be the case for me, college is starting to be a long time ago for me).

Honestly right now, without looking up the answer, I probably can't reverse a binary tree on a whiteboard. I could, however, do it by test driving a solution with a real computer (I haven't flexed those muscles in a long time, but test driving would help me dig into the recesses of my brain).

Which skill set is more useful for production quality software? I can say for sure that it's not white boarding.

Deriving trivially provable algorithms in a test-driven way, by trial and error, hoping that no edge cases are missed? Sounds really, really depressing. The future of software engineering is very bleak if this approach is a new norm.
My point was that I would start by test driving to "dust off the cobwebs", as it were.

Personally, I don't actually believe in truly "mindless", trial and error TDD, as oftentimes it will miss the forest for the trees.

Amusingly now, three days later, I'm certain I could do this nonsense on a whiteboard now, as thinking about it three days ago seems to have primed my subconscious to dig it up.

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.
Is it not obvious that you reverse the left and right subtrees and then swap them?

I learned how to think recursively in college. I never learned how to reverse a binary tree.

What? You do not need to know anything at all. The very wording of this problem is already a solution. No thinking required. No prior knowledge required.
They also teach things like this in boot camps now. The graduates are trained to game these tests because placement rates are so important to boot camps.

Assuming someone is a good programmer because of trivial examples like reversing a binary tree or, worse, writing a bubble sort is like asking someone you to use a wrench to prove that you're an architect.

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.
> knowing how to devise algorithms to accomplish a given task is a necessary competency

Agreed. Why not use a realistic problem and setting?

Because realistic problems tend to be far bigger than the small, fundamental building blocks.
That's a really big obstacle, but it's not insurmountable. My companies often ask if the candidate is willing to be a contractor for a couple of weeks. If they're not currently working, it gives them some income to continue the job search, and it allows us to see what it's like working with them.

I can usually tell that someone is unacceptably bad within a few days of working with them, so it makes sense to do those few days before hiring (if possible).

Imagine you have one position, and 15 people were screened for an interview. What would you do with 15 contractors? Even if you run a Microsoft department it would not make much sense.

Trivial problems are a good filter, as long as you manage to maintain a non-stressful interview environment. Whiteboard coding is a good thing, because it shows that one really understands things, not just memorised keystrokes.

Doing about 80% of my work on a piece of paper, I cannot really comprehend all the moaning about whiteboard being "detached" from anything practical.