12 patterns
Learn the pattern once, then recall it cold.
Pattern
Review path1dthen4dthen16d- 01Two PointersTraverse arrays efficiently with two indicesEasy · 15 problems
- 02Sliding WindowSolve subarray/substring problems in O(n)Medium · 12 problems
- 03Binary SearchDivide and conquer for O(log n) searchEasy · 10 problems
- 04StackLIFO for brackets, monotonic problemsMedium · 12 problems
- 05Linked ListPointer manipulation and cycle detectionMedium · 10 problems
- 06Tree TraversalDFS and BFS for binary treesMedium · 15 problems
- 07Graph AlgorithmsBFS/DFS for graphs and gridsMedium · 12 problems
- 08BacktrackingGenerate subsets, permutations, combinationsHard · 10 problems
- 09Heap / Priority QueueTop-K and streaming problemsMedium · 8 problems
- 10Dynamic ProgrammingSolve overlapping subproblems optimallyHard · 20 problems
- 11GreedyLocally optimal choices for global optimumMedium · 10 problems
- 12IntervalsMerge, insert, and schedule intervalsMedium · 8 problems
How to study coding patterns efficiently
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.
- Pick 2-3 patterns per week instead of spreading effort across all 12.
- Track misses by pattern so your next review session is focused.
- Practice one timed set weekly to pressure-test pattern recognition.
Pair these with other guides
Ready to master these patterns?
Practice with FSRS spaced repetition - the algorithm used by medical students to memorize thousands of facts. Never forget a pattern again.
Start Free Practice