News for hackers. Stuff that matters.
Re:Neural programmer better than Quicksort by User23 on Friday July 10, 2020 @12:54PM (#23793523)
> The same was true for java's binary search

I used to ask "implement binary search" as an interview question and gave up on using it because not a single candidate could do it correctly in 45 minutes. This was at a FAANG.

Re:Neural programmer better than Quicksort by vertbhrtn on Sunday July 12, 2020 @04:56AM (#23809963)
Ha, I can get an offer from any of the FAANG without even trying and can comfortably say that not only I failed the binary search question in past when interviews were 1 hour long, I would still fail it now.
Re:Neural programmer better than Quicksort by Der_Einzige on Friday July 10, 2020 @01:05PM (#23793649)
I don't believe you. Surely, after a few hints, the FAANG canidates must have been able to figure out the classic gotcha of this question (why does this sometimes overflow and how do you fix {high + low / 2})

If they didn't, than I believe you did a poor job of guiding them. I refuse to believe that this is some esoteric, tough question. If you can solve dynamic programming problems, you can easily solve this one.

Re:Neural programmer better than Quicksort by nardi on Friday July 10, 2020 @01:16PM (#23793800)
I interview tons of candidates at a FAANG company, and I can tell you for sure binary search is way too hard to get right on a whiteboard. Even in a proper coding environment I wouldn't ask it. There are lots of better questions with fewer sharp edges.
Re:Neural programmer better than Quicksort by Der_Einzige on Friday July 10, 2020 @02:24PM (#23794631)
What else is hard besides converting

(high + low) / 2

To

Low + (high - low) / 2

What else about this problem is a "sharp edge"?

Re:Neural programmer better than Quicksort by nardi on Friday July 10, 2020 @02:38PM (#23794797)
I may have been a little too harsh. Binary search is close to being a good interview question, especially since the algorithm does, rarely, come up in real code. But I prefer questions that are more like what people will be doing in their day-to-day job, and binary search is just a little too fiddly.
Re:Neural programmer better than Quicksort by CamperBob2 on Friday July 10, 2020 @04:07PM (#23795815)
Me: "Show me a binary search in C on the whiteboard."

Candidate: bsearch(key, base, num, size, compare_fn);

Me: "Your offer should arrive within one to two weeks. Need any help with relocation expenses?"

Re:Neural programmer better than Quicksort by nardi on Friday July 10, 2020 @04:21PM (#23795992)
100% this. Maybe not everyone knows the specific function you’re looking for, but for the ones that know standard library APIs really well, that’s your hire.
Re:Neural programmer better than Quicksort by User23 on Friday July 10, 2020 @06:17PM (#23797222)
I wouldn’t say so. In theory you’d expect a FAANG engineer to be able to construct a correctly terminating loop by reasoning about the loop invariant, but in practice every single candidate gets lost in guesswork and messing up the edge cases and termination condition.