|
|
|
|
|
by umanwizard
2565 days ago
|
|
I'm a big fan of testing basic CS knowledge in technical interviews, which puts me against the dominant narrative on HN. But even I think knowing how to implement an RB tree off the top of your head is more about having prepared for whiteboard interviews than about actual knowledge or skill. I'd say it'd be a bonus for me to have a general understanding of how some sort of self-balancing tree works. For example, for red-black trees I'd be happy with stating the invariant about same number of black nodes along any given path and no two red nodes in a row, explaining why this guarantees O(log(n)) worst-case lookups, and also mentioning the basic notion that you can bubble rotations up the tree so the time it takes to do an update or delete is proportional to path length and so again O(log(n)). I don't think that remembering off the top of your head the exact code for all 7 (or however many it is, idk) different rotation cases provides any additional signal. |
|