Algorithm Patterns
The handful of shapes that cover almost every problem a live-coding screen will hand you.
7 topics
Hashing and frequency counting
The single highest-yield pattern in a live-coding screen — trade memory for a lookup table and a nested loop collapses to one pass.
core20 minTwo pointers and sliding window
Two indices moving through one array in `O(n)` total, covering most subarray, substring, and sorted-pair problems without extra space.
core20 minSorting and comparators
You will not implement a sort, but you will be asked which one runs, whether it is stable, and why your comparator produced nonsense.
core20 minBinary search and search on answer
Halving a space per step gives `O(log n)`, and the powerful version searches a range of possible answers rather than an array.
core20 minGraph traversal — BFS and DFS
The same algorithm with a different container, and the choice decides whether you get shortest paths or a natural recursion.
core25 minRecursion, backtracking, and memoisation
Solve a problem in terms of a smaller version of itself, undo choices that fail, and cache subproblems so the tree stops exploding.
core25 minDynamic programming
Memoised recursion with a name — worth being able to recognise and derive, but rarely the point of a senior frontend loop.
deep25 min