Hacker News new | ask | show | jobs
by deckard1 2039 days ago
Even if you know the broad strokes, asking the average developer to implement most data structures will be a disaster. I'm reminded of the fact that most binary search algorithms are badly broken:

> When Jon Bentley assigned binary search as a problem in a course for professional programmers, he found that ninety percent failed to provide a correct solution after several hours of working on it, mainly because the incorrect implementations failed to run or returned a wrong answer in rare edge cases. A study published in 1988 shows that accurate code for it is only found in five out of twenty textbooks. Furthermore, Bentley's own implementation of binary search, published in his 1986 book Programming Pearls, contained an overflow error that remained undetected for over twenty years. The Java programming language library implementation of binary search had the same overflow bug for more than nine years.

Knuth had this to say:

> Although the basic idea of binary search is comparatively straightforward, the details can be surprisingly tricky

https://en.wikipedia.org/wiki/Binary_search_algorithm#Implem...

If the experts can't get it right, no developer in an interview setting has a chance. It's a game of "gotcha." The interviewer has some trick that they are privy to and are waiting for the interviewee to mess up and... GOTCHA! You got it wrong, it's this clever trick that you would have to know ahead of time! Silly person thinking they can get a job here without knowing the secret handshake.