5 ms·
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
by askyourmother 11y ago
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 answer a specific trick interview question, and that's all that matters, right? Right?
Sigh.
- rntz 11y ago> If you hire using know it or not questions about binary trees The article author doesn't think of his question as a "know it or not" question, but a "you should be able to figure this out" question: > Here's the first reason why this question is so good: a skilled programmer can map their intuition to code. You can tell at a glance whether a binary tree is symmetric, but beginners will often struggle with a question like this because they approach this problem from a visual/intuitive angle rather than the logical angle. I think it's a fair criticism to say that, at this point, "reverse a binary tree" is something a lot of applicants will have simply memorized rather than figuring out on the fly. But (to play Devil's Advocate) isn't the goal of the question - to test a candidate's ability to think logically and problem-solve on the fly - a reasonable one? It seems to me the real problems with whiteboard-coding interviews aren't that what they're trying to test - problem-solving on the fly - isn't useful or valuable, but that whiteboard coding is confounded by so many irrelevant variables: ability to think under pressure, ability to code "in your head" (without an editor, IDE or REPL), memorizing solutions, and so forth.
- kolbe 11y agoAt the very least, it means they studied up on the tricks. That's good for something.
- joslin01 11y agoHow 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? Programmers are so sensitive, and honestly all your "sighing" is obnoxious. You don't have it all figured out.
- baby 11y agoI think most people here miss the point, thinking that they need to know about symmetric binary trees in order to be able to answer such questions. These kind of tests are aiming to find developers who can think out of the box and start solving problems they haven't heard of before. This is quite a simple problem to solve if you start thinking about it. If you get stuck because of the binary tree and because you've never done that before, then I believe you would be a mediocre dev (which is not a problem in many companies).
- smt88 11y ago> 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 figured out, nor are the majority of comments an implication of that. We're all just saying we have one thing figured out: whiteboard interviews are terrible, alienating, unrealistic, antiquated tools for hiring. Your profile says you're a CTO, and you should know that research increasingly shows that people don't quit jobs, they quit bosses. If you want to be the kind of boss that programmers want to work for, you should be more open to understanding why the vast majority of us feel strongly about a topic like this instead of calling us obnoxious. If you yourself are not a programmer, I'm not sure why you're weighing in on this at all.
- joslin01 11y agoI'm actually not annoyed nor do I misunderstand why people are sighing. Your emotional appeal does not hold much weight when faced with real business practices of hiring "the best" that every organization is going to strive for. 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.
- eonw 11y agowhen 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.
- cwilkes 11y agoYou dodged a bullet there. Maybe you can use this as a canary to tell if a company is one you want to work for based on questions they ask.
- JBReefer 11y agoSeeing as Yahoo! completely lost the race to hire the "best and brightest," and is now teetering on the brink of dissolution, I'd say that you: a. dodged a bullet b. should basically do the exact opposite of every part of their hiring practices
- pessimizer 11y agoIt also doesn't mean the candidate will get along with their co-workers, take direction well, ask for help when needed, or bathe before coming to work. Since when have we required that a necessary qualification be a sufficient qualification?
- nostrademons 11y agoThe point is that this is not a "know it or not" question. You should be able to derive this answer, even if you've never seen it before, by combining things that you should have seen, because they show up all the time in CS. In the first approach he gives, you need to divide the problem into smaller subproblems, knowing that a tree is the combination of either two branches that are themselves trees or a single leaf node. What's the rule for determining whether two trees are symmetric? Well, if both of them are leaves, the answer is trivially true. If one of them is a leaf and the other is a branch, the answer is trivially false. If they are both branches, then you need to make sure that the left branch matches the reversed copy of the right branch, and vice versa, i.e. left is symmetric to right and right is symmetric to left. And you have the solution he gave. That also clues you in to the second solution, where you define "symmetric" as "the reverse of tree1 is equal to tree2", and then write appropriate recursive helper functions for this. What the author's really testing for is "Can you decompose problems that you don't know how to do into problems that you do know how to do?" This is a critical skill for doing anything new, and the vast majority of economic gains in the software industry go to people producing new stuff and not looking up other peoples' solutions. Effectively, what he's trying to select for is folks who don't believe this is a matter of received wisdom and instead are willing to figure it out themselves. (Interestingly, there's a bug in his code. It doesn't affect the correctness of the point he's trying to make, but would be infuriating to an actual Javascript programmer working with this function. See if you can spot it before he merges my pull request...)
- minimaxir 11y ago...and can you reason though all of this in 15 minutes with 1-2 people staring at you?
- nostrademons 11y agoWhy not? (I get that some people have legitimate anxiety issues when placed in a situation where they're being judged and have to perform rationally under pressure. Hell, I face this every day when I think about getting customers and delivering to them. But these are worth working through on their own: there are many situations besides interviews where you will be forced to make clear & correct decisions under time pressure and are being judged on the results. The key is to focus on the thought process, not the judgment: the interviewer is irrelevant, if he doesn't like what you do go off and find another interviewer.)