Common Problem Patterns

intermediate15 min

Common Problem Patterns Overview

Most problems reuse a small set of shapes. Naming the shape early saves minutes of brute force that cannot pass anyway.

  • Sliding Window
  • Two Pointers
  • Fast & Slow Pointers
  • Binary Search
  • Prefix Sum
  • Backtracking
  • BFS/DFS
  • Topological Sort
  • Union Find
  • Bitmasking
  • Greedy
  • Dynamic Programming

How to Use Patterns

On a new problem, ask which pattern fits before you write code. Drilling one pattern at a time on a platform builds faster recognition than random difficulty order alone.