Hacker News new | ask | show | jobs
by jcranmer 2060 days ago
So, in my job, I've had a few, rare reasons to actually push into developing new algorithms for problems nobody has had to solve before. Literally nothing I've had to do for leetcode or whiteboarding has been useful there.

The more common instance I've had to do is plug-and-play existing algorithmic design on existing data structures that are well-represented in libraries. Need a hashtable or an auto-growing array? That's in virtually every standard library. Balanced search trees are also pretty common, although (in my experience) actually quite rare in practice. Graphs are usually not in standard libraries, but graph libraries are pretty standard in languages: there's petgraph in Rust, Boost has graphs in C++, and Python has networkx. Just pop those libraries in, and you don't need to bother implementing anything basic like traversals.

The only things exotic enough that I've had to personally implement them myself are Johnson's algorithm for elementary circuits and the union-find datastructure. Both times, I've had the algorithm in pseudocode right in front of me when writing the code, so I've never had to actually memorize how these things work.