🎉 All 30 days are live — the full DSA-30 course, from Big-O to System Design. See the roadmap →
Pattern Map

The Pattern Map

Almost every coding problem is a known pattern wearing a costume. The meta-skill — the thing interviews actually test — is stripping off the costume to see the shape underneath. This page is the decision guide for doing exactly that, plus a drill that forces you to recognize patterns instead of being told which one to use.

Bookmark it. It’s the single best thing to re-read the morning of an interview.

”If you see this, reach for that”

The decision guide — "if you see this, reach for that"
Filter by a keyword from the problem, or skim them all. Tap a row to reveal the technique.
If you see… Sorted array, find a pair / target+
If you see… Subarray / substring with a constraint+
If you see… "All permutations / combinations / subsets"+
If you see… "Max / min / count ways" + overlapping subproblems+
If you see… Top-k / k-th largest / streaming median+
If you see… "Have I seen this before?" / dedupe / frequency+
If you see… Shortest path in an unweighted graph+
If you see… Shortest path with weights+
If you see… Connected components / "are these joined?"+
If you see… Ordering with dependencies / prerequisites+
If you see… Prefix queries / autocomplete / word set+
If you see… Range sum/min/max on a mutable array+
If you see… "Next greater / smaller element"+
If you see… Matching parentheses / undo / DFS by hand+
If you see… "Maximize XOR" / bit-level constraints+
If you see… Search the ANSWER, not the array ("min capacity such that…")+
If you see… Linked list cycle / find middle+
If you see… Count inversions / "smaller after self"+
If you see… Greedy feels right (intervals, scheduling)+
If you see… "Design a system that scales to millions"+

The clue is almost always in the problem’s constraints and verbs, not its story. “Contiguous subarray” → sliding window. “All possible…” → backtracking. “Minimum X such that…” → binary-search-on-the-answer or DP. “Already sorted” → two pointers or binary search. Underline those phrases first — they’re the seams of the costume.

Drill: name the pattern

Reading the map is passive. This is active: you get a problem with the technique hidden, and you have to decide the approach yourself before revealing it. That decision — under mild uncertainty — is the muscle the interview works.

Interleaved drill — name the pattern0 drawn
The skill interviews test is choosing the technique. Draw a problem, decide the approach in your head, then reveal.
⚠️

Interleaving is uncomfortable on purpose. Practicing 20 sliding-window problems in a row feels productive but teaches you almost nothing about recognizing sliding window — you already know that’s the day’s topic. Mixing problem types (like this drill, and like a real interview) is harder and slower, and that “desirable difficulty” is precisely why it sticks. If it feels easy, you’re not learning.

Go deeper

Finished this page?