Master the 12 essential patterns that appear in most coding interviews. Learn the pattern once, solve hundreds of problems.
Traverse arrays efficiently with two indices
Solve subarray/substring problems in O(n)
Divide and conquer for O(log n) search
LIFO for brackets, monotonic problems
Pointer manipulation and cycle detection
DFS and BFS for binary trees
BFS/DFS for graphs and grids
Generate subsets, permutations, combinations
Top-K and streaming problems
Solve overlapping subproblems optimally
Locally optimal choices for global optimum
Merge, insert, and schedule intervals
Pattern study works best when you move from recognition to recall. Read one pattern guide, solve 2-3 problems, then return to the same pattern later in the week without notes. That second pass is where long-term retention starts.
If interviews are close, focus on two pointers, sliding window, binary search, trees, graphs, and dynamic programming first. For each pattern, keep a one-line trigger in your notes, such as "sorted array plus pair target" for two pointers. This speeds up pattern selection when you see an unfamiliar prompt.
In live interviews, always state the pattern hypothesis before writing code. Even if you adjust later, this shows structured thinking and helps interviewers evaluate your tradeoff reasoning, not just final syntax.
Practice with FSRS spaced repetition - the algorithm used by medical students to memorize thousands of facts. Never forget a pattern again.
Start Free Practice