Comment by rnovak

11 years ago

I don't necessarily agree though, I think if you can reason about a problem, you are infinitely more valuable than someone who memorizes problems and just applies them blindly.

Correct me if I'm wrong, but a binary search tree is a very simple data structure. It has rules, and just by it's definition, and the definition of "inverted", you should be able to come up with an iterative solution, even if it's just walking the tree and re-creating it.

It may not be the best, but it's a solution, it's a starting point.

But if you're interviewing for a job solving problems, shouldn't you be able to solve problems? Even if they aren't the best solution? Genuinely asking here, as this approach seems to have a 85-90% success rate for me.

It depends how your interviewer is ranking/scoring you. One interviewer might be impressed with your ability to talk through and solve the problem from first principles, where another might ding you for not instantly knowing the answer. The former type of interviewer would be happy to give you hints and prompts, the second is a stone wall. I try to be the first -- it helps assess how a candidate responds to coaching too! -- but there's a spectrum between "nudging" and "telling them the answer straight out".

  • > where another might ding you for not instantly knowing the answer

    While there certainly are incompetent interviewers, I think ones that extreme are rare.

    • I've definitely seen interviewers (both by reading other people's feedback, and in one rare case, being an interviewee) who expected a "correct" answer and wouldn't work with the candidate to get there if they didn't already know it.

      See also: overused brainteasers. I remember being asked the 5 litre / 3 litre / get 4 litres problem for my Microsoft intern interview, and honestly told them that I already knew the answer, so I wouldn't be "solving" it, but here it is anyway...

      1 reply →

Is a binary search tree a problem that the Dev would have needed to solve? In over 5 years as a dev, I have never once needed to solve a binary search tree. Why not ask the candidate how to perform a kidney transplant.. That's solving a problem too. White boarding algorithms is not relevant to the majority of Dev jobs. It's related, but not particularly valuable as a screener.

  • I'm not sure how asking someone who's going to be working in computer programming something about computer science is equal to asking someone who's going to be working in computer programming something about medicine. Those two things aren't equivalent. Could you perhaps clarify?

    Engineering is the use of knowledge/science to solve problems, right? So why is asking someone to use knowledge to solve a problem not applicable to the hiring process?

    To be clear, this isn't the same question as "why are manhole covers round", or "how would you move a mountain".

    • The act of creating a, say a self balancing binary search tree, is something you should know about. If you ever have to implement it, you go look it up. Engineers are exactly the same - you would rather have one that know where to look up all the stuff, or search for information, than one that can regurgitate the entirety of his education theory.

Typing "how to reverse a binary search tree" into google is not the same thing as solving a problem.

If these problems were so reliant on individual problem solving ability, there wouldn't be dozens of books with reams of answers to these questions on the market. These questions test memorization and nothing else.

  • I mean, that's a little strong. My undergrad degree is in math, so I would be thrilled if I was sitting in an interview and was being asked questions like that instead of stuff about how computers actually work.