Strong candidates don't know more algorithms โ they recognise problems faster. Interview problems are variations of ~15 reusable patterns. Learn to spot the signal words, and half the battle is over before you write code.
The signal โ pattern table
The problem says... โ Reach for... โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ "sorted array" + find/search โ Binary Search "pair / triplet that sums to..." โ Two Pointers (sorted) or HashMap "longest/shortest SUBSTRING or SUBARRAY" โ Sliding Window "linked list" + cycle / middle โ Fast & Slow Pointers "overlapping intervals / meetings" โ Merge Intervals "top K / K largest / K most frequent" โ Heap (or sort if small) "how many ways / min cost / max value" โ Dynamic Programming "all combinations / permutations" โ Backtracking (DFS) "shortest path / level by level" โ BFS "valid parentheses / undo / nearest greater" โ Stack "range sum queries" โ Prefix Sum "count / frequency / seen before?" โ HashMap / Set
The 4-step routine for every problem
- Restate + clarify โ inputs, outputs, edge cases ("empty array? duplicates? negatives?").
- Say the brute force out loud โ "nested loops give O(nยฒ)". This scores points AND anchors your optimisation.
- Scan the signal table โ sorted? substring? K? intervals? Pick the pattern candidate.
- Apply the pattern template โ each lesson in this course gives you one to adapt.
How to use this course
Each lesson = one pattern: when to use it, the code template, a worked example, and problems on our DSA judge to solve immediately. Don't just read โ the pattern only sticks after you've used it twice. Start with Two Pointers.