by cdelsolar · 4y ago · 0 comments
Maybe I just have a skewed perspective as a grad student working on filesystem stuff, but I can’t imagine going for years without having to solve some kind of graph problem.
(Not the GP) I mostly do "backend" work, my limited experience with the frontend (mostly javascript) is that you actually need to deal with (explicit) tree structures more in the frontend. The DOM tree is one, for example. Other UI elements can be modeled quite nicely with a tree structure too.
If it has tail call optimization and clean pattern matching syntax, then recursion tends to be the more readable (and equally performant) way to traverse data structures, especially anything more complicated than a 1-dimensional list.
These two features (tail call optimization and pattern matching) have seen a surge in popularity over the last decade, notably in Rust.
A whiteboard interview tests your ability to do something you do constantly while writing code: you look at the code you wrote and run it in your head with enough fidelity that you can verify it to a first approximation. If you can’t do that, you’re going to be slower and you’re going to make more mistakes than someone who can.
Small contrived problems like recursion are useful for testing this specific skill. A program to calculate e.g. Fibonacci using recursion isn’t that complicated; to me it seems like table stakes for actually writing new software.