The thousands of LeetCode-style questions collapse into about twenty reusable tools. Every chapter is a live, interactive deep-dive that teaches you to recognize the pattern from the problem statement ā then apply a skeleton you already know.
Before any code: what the interview actually measures.
What you'll learn. Why thousands of problems collapse into twenty patterns ā and how to farm that.
What you'll learn. A six-step loop so you're never staring silently at a blank editor.
What you'll learn. Read the constraints, know the complexity budget, eliminate half the patterns before thinking.
Seven patterns that solve half the bank.
What you'll learn. The hash map: trade memory for a time machine.
What you'll learn. Walk from both ends and discard half the space per step.
What you'll learn. The caterpillar scan for longest-and-shortest contiguous anything.
What you'll learn. Precompute once, answer range questions forever; sort and sweep the calendar.
What you'll learn. The undo pile ā and its sorted cousin that answers "next greater" in O(n).
What you'll learn. Halve or die: on arrays, on rotated arrays, on the answer itself.
What you'll learn. Rewire boxes-and-arrows in place; two runners find cycles with no map.
Trees: where recursion stops being scary.
What you'll learn. Trees: go deep with a string, or floor-by-floor with a queue.
What you'll learn. The BST bargain, and the two shapes every tree recursion takes.
What you'll learn. The prefix tree: autocomplete in O(word), no matter the dictionary.
What you'll learn. The almost-sorted pile: top-k, streaming medians, k-way merges.
When the structure is a web ā or you must try everything.
What you'll learn. Grids are graphs; BFS floors are shortest paths; islands everywhere.
What you'll learn. Dependency order and near-O(1) connectivity bookkeeping.
What you'll learn. Dijkstra: BFS that expands the cheapest frontier first.
What you'll learn. Choose, explore, un-choose ā brute force with manners and pruning.
Greedy when you can prove it, DP when you can't.
What you'll learn. Take the best bite now ā legal only if you can prove one sentence.
What you'll learn. Recursion that stopped repeating itself: memo, table, done.
What you'll learn. Grids, string pairs, and knapsacks: the 2-D table family.
What you'll learn. XOR cancellation, bit choreography, and matrix gymnastics.
Recognition, rehearsal, and the day itself.