News for hackers. Stuff that matters.
Re:Harder programming questions do a worse job of predicting... by em-bee on Tuesday February 19, 2019 @08:03AM (#19198616)
regarding the simpler solution, i just had that situation today. working on elevatorsaga.com the candidate clearly wanted to solve the full problem correctly (the way a real elevator works) from the get-go. however doing so would have taken him several hours without him knowing if he got any closer to a working solution.

i had to push him to try something simpler first just so that he would get to somewhere meaningful within the hour available.

so which approach is better depends on the goals. in my case i wanted the candidate to solve the basic problem first: (make every person get to their destination, no matter how long the elevator needs) and then optimize to make it go faster.

Re:Harder programming questions do a worse job of predicting... by PopeDotNinja on Tuesday February 19, 2019 @10:40AM (#19199656)
I hear what you're saying, I do. But if the candidate knows what an optimal solution is, and that optimal solution takes several hours, maybe you're asking a question that is too big?

For example, asking someone to write a self balancing binary search tree in an interview might be too much. And asking a question that ultimately demands using a self balancing BST might be a bit much. It's like asking a question that really needs an associative array, but then imposing the rule that associative arrays aren't available. How about simply asking the candidate about binary trees, if they've used them, and what they've used them for?

Last week an interviewer asked me about if I was familiar with the Egg Dropping problem (https://brilliant.org/wiki/egg-dropping/). I wasn't, but I remember saying something like, "I haven't done this one before, but I'm pretty sure it's going to take O(log n) guesses to find the max floor from which you can safely drop the egg." The interviewer asked me how I'd implement it, and then we got into the weeds when I started asking for what the requirements were. He wouldn't share any information about inputs & outputs, so I just started writing the dumbest thing possible, predictably coded myself into a corner, and burned a potential interview win-win on learning how answer that kind of question for that kind of interviewer.