Algorithms Interviews: Theory vs. Practice
danluu.com
danluu.com
Algorithmic questions started with Microsoft, who wanted to make sure engineering hires could... program!
The point was to make it as language agnostic as possible and friendly to college hires (since everyone who did a serious CS program did algorithms, there was a common vocabulary). You weren't even meant to study intensively for these, just brush up on your algo class.
But now I keep seeing guides on the internet about "hacking the coding interview" and special "prep material" pushed by influencers (???) on YouTube that claim to be ex FAANG (hard to check). Apparently there's even classes taught at tier two colleges (Waterlo if I recall) that specifically focus on algorithm interviews. Not algorithms, just algorithms interviews. They get interview questions from students and the class is just memorizing as many of them as possible.
In my experience, there's a point where it becomes 100% cargo-culting/rote.
The best approach is to keep the coding (it's essential to be able to write code on the whiteboard, period) and have some elements of algorithmic reasoning but focus on using those to solve a real problem.
1) many Leetcode style solutions are to problems that were at one time practical engineering problems; cycle detection infact is still relevant in cryptography.
2) novel implementations are required all the time in companies that have bandwidth for greenfield projects (ie FAANG). For example, if you search through the source of pytorch (or tensorflow) you will find implementations of the solution to https://leetcode.com/problems/merge-intervals/description/
So everyone always lamenting how useless Leetcode is, is pretty much telling on themselves re the kind of work they do.
Edit: though this isn't what you broach, people that think there's no meaningful difference between eg O(n^2) and O(nlogn) are also broadcasting to the world that they've never run code "at scale". These companies have power bills that are denominated in Bs not Ms and so improving perf by even 1% (on a critical hot path) can be worth millions to the company (and RSU refreshers to you). If you don't believe me then believe Andrei alexandrscu
https://youtu.be/ea5DiCg8HOY?t=175
>So if you shave 1% you've made your salary for 10 years alone
"Someone with a 2300 ELO is a good player. Someone with a 2750 ELO has wasted their life"