3 ms·
I'd say roughly 3/4 of the problems in the link are... actually very straightforward to implement on a whiteboard, even if you're focusing on precision. There
by commandlinefan 6y ago
I'd say roughly 3/4 of the problems in the link are... actually very straightforward to implement on a whiteboard, even if you're focusing on precision. There are some in there, like balanced binary tree, that I doubt even Knuth could get right from memory, but I'd hope that nobody would ever actually expect somebody to recite the details of an AVL implementation off the top of their head.
- hinkley 6y agoI had a classmate who insisted he found a bug in the R-B tree implementation in CLR, but I was too busy with something else to insist that he prove it to me. I don't want coworkers who think implementing a sort algorithm by hand is an asset. It's not. It's a skill that has to be managed meticulously, and we rarely if ever do anything meticulously. It's not an asset, it's a liability. Understanding how to balance multiple constraints at once is as asset, and sort algorithms are one of the ways we are introduced to this. Mastery requires that you see the scaffolding of your education as something to be jettisoned when the project (you) is finished. A lot of very productive people never achieve mastery. In the same head space as sorting, a lot of people can't implement a custom comparator properly. Sorting is worthless if you can't decide what to sort by. Most people learn about comparators after learning about sort algorithms, so you can in some cases argue your fellow interviewers out of an AVL tree and into sorting customers by name and registration date. Or taking a list of inventory sorted alphabetically and grouping it instead by price range.
- 908B64B197 6y agoI have faith in Knuth, but he's an extreme outlier. The balanced binary tree is a rough one. But checking that a tree is balanced would be a nice whiteboard problem.