top | item 26793375

(no title)

jblow | 4 years ago

If you can’t reverse a binary tree, or don’t even know how to approach the problem, you can’t do most of programming. Fixing this should be a high priority, but the author seems to have no awareness of this.

Programming is hard. It takes a lot of skill to do it well. If the author seemed interested in acknowledging this and developing skill, the article would not come off as whiny and pointless. But it does, because he’s not interested in identifying and fixing the problem, which resides in his own house.

discuss

order

chowells|4 years ago

Reversing a binary tree isn't some crazy algorithmic knowledge. I'm concerned that so many people here think it is. What's gone wrong that makes people think reversing a binary tree is up there with hand-coding machine learning techniques?

Reversing a binary tree is a basic test of whether you can implement a trivial requirement given a spec. How is that not related to what you do every day on the job? You get a lot of requirements, most of which are trivial tasks needed to maintain compatibility with some broken external system that will never get fixed. The solutions are two to five lines of code, once you've taken the time to understand the requirements properly - just like reversing a binary tree.

This is neither a task that needs to be studied for nor an unfair pop quiz. It's an easier version of fizzbuzz. (You don't even need to worry about gotchas like getting case ordering wrong the way you do in fizzbuzz.) All it checks is that you have the basic skills necessary for reading and comprehending requirements and then meeting them with trivial code.

If you can't do that, what should an interviewer conclude about your capacity to do the job?

pedrosorio|4 years ago

> up there with hand-coding machine learning techniques

A toy implementation of machine learning algorithms (e.g. backprop on an arbitrary neural network) on the CPU, is pretty simple as well.

lostcolony|4 years ago

"Can't reverse a binary tree" is different from "Can't do it flawlessly enough in an interview setting". It also isn't necessary to provide business value. The things I spend 98% of my time on at work are not raw data structures, but leveraging those data structures.

The fact many companies interview for something that is mostly unpracticed by candidates in the field (only those practicing it at home), and won't actually be done on the job if hired, is a very strange place our industry finds itself in.

Kranar|4 years ago

There's nothing strange about it. You are simply looking at the problem from the point of view of the candidate instead of from the point of view of the business.

The vast majority of developers can absolutely do 80% of the job I give them to some sufficiently reasonable degree, but I'm not hiring people for the 80% of the job. My issue as a company is finding people who can nail the remaining 20% of the job. That's very hard to find but it's absolutely critical in a business as competitive and cutthroat as technology.

The fact that most developers don't have a basic understanding of fundamental and core concepts really does have a measurable impact on the quality of software and almost all of us, as consumers of software, pay a penalty because of it.

We put up with slow, bloated, and inadequate software because we take for granted core computing concepts, fail to appreciate the hardware our software runs on, and write software in an unbelievably indulgent manner.

Some of this is alleviated by relying on frameworks provided by the major tech companies to deliver software and that certainly helps quite a bit but this benefit doesn't come for free; it results in vendor lock in, code rot, and a genericization where many software products end up being bland and derivative because everyone is gluing together the same frameworks.

dave_sullivan|4 years ago

For the record, I did look it up (back then) and I know how to do it. It's really simple. I still think it's stupid to ask about in an interview.

kingsuper20|4 years ago

I'd say that reversing a binary tree can be solved in two ways.

1. Never having thought about it before, generate an acceptable whiteboard algorithm from scratch while having a person or three bore holes in your back.

2. Throw a canned answer on the board.

My impression is that large companies prefer Door Number 2.