|
Fully agreed. I usually don't need complex algorithms in my line of work, but I can't count how many times I've needed to implement topological sorts, for instance, or non-trivial tree traversals, or to rewrite code to increase parallelism, or to be able to quickly spot that a poorly performing algorithm was O(n^2) or O(n^3). And sometimes, it actually gets complicated. Sometimes, it's about increasing cache hits. Sometimes, it's about making sure that stuff gets allocated in the right order or in the right place in memory. Sometimes, it's about rewriting the IPC layer. Sometimes, it's about reimplementing foreign key logics in a low-level database/file system. Sometimes, it's about writing custom locking data structures or non-blocking algorithms, or a custom memory allocator or GC to match specific performance requirements. Sometimes, you need to do all of this without a debugger or a profiler or even logging. If you can't handle the simple tasks from the first list, well, how are you going to tackle the issues from the second? And if you're not curious, how are you going to learn all of this? |
Personally I wouldn't start writing a single line without doing some research first. I'd look around on the web for some sample implementations or at least pseudocode. I'd probably get one of my algorithm books down from the shelf to make sure I understand the basics -- and check for "gotcha" edge cases.
So this is still wildly different than Max's interview environment, where the expectation is that you can effectively invent the algorithm.