Sweaty Imposter

Pattern Roadmap

Each tier builds on the one before it. Color shows how much of each pattern you've rated Solid.

  • Solid, 80% and up
  • Learning
  • Weak, mostly Missed or Shaky
  • Not Started
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

Arrays & Hashing

13 problems

Hash maps and sets that turn pair-by-pair comparisons into one pass. The starting point for every other pattern. Leads to Two Pointers, Stack, Cyclic Sort, Bitwise XOR, Merge Intervals, Linked List, and Math & Geometry.

13 problems. Next up: Two Sum.

Patterns by Tier

Tier 1

  • Arrays & Hashing

    Hash maps and sets that turn pair-by-pair comparisons into one pass.

Tier 2

  • Two Pointers

    Two indices converge on a target across a sorted or paired sequence. Builds on Arrays & Hashing.

  • Linked List

    A dummy head and careful pointer writes for merging, removal, and copies. Builds on Arrays & Hashing.

  • Math & Geometry

    Index formulas for matrices, digit carries, overflow checks, and fast powers. Builds on Arrays & Hashing.

  • Stack

    The most recent unfinished item stays on top for matching and nesting. Builds on Arrays & Hashing.

  • Merge Intervals

    Sort ranges by start, then sweep once to merge or count overlaps. Builds on Arrays & Hashing.

  • Bitwise XOR

    XOR cancels equal values, so a single pass finds the odd one out. Builds on Arrays & Hashing.

  • Cyclic Sort

    Swap each value to its own index when values fall in a known range. Builds on Arrays & Hashing.

Tier 3

  • Sliding Window

    Grow and shrink a contiguous window while tracking an aggregate. Builds on Two Pointers.

  • Modified Binary Search

    Halve a sorted or monotonic space, including the answer itself. Builds on Two Pointers.

  • Fast & Slow Pointers (Floyd's)

    Pointers at two speeds find cycles and midpoints in linked structures. Builds on Two Pointers and Linked List.

  • In-Place Reversal of LinkedList

    Rewire next pointers in place with prev, current, and next. Builds on Two Pointers and Linked List.

  • Monotonic Stack/Queue

    A stack or deque kept in order answers next greater and next smaller. Builds on Stack.

  • Tree DFS

    Recursive or stack-based traversal in pre, in, or post order. Builds on Stack.

  • Greedy

    Take the locally best choice when it provably leads to the global best. Builds on Merge Intervals.

Tier 4

  • Top K Elements

    A heap of size k tracks the k largest, smallest, or most frequent. Builds on Tree DFS.

  • Trie (Prefix Tree)

    A tree keyed by characters for prefix lookups in O(length). Builds on Tree DFS.

  • Tree BFS

    Level-order traversal with a queue, one level at a time. Builds on Tree DFS.

  • Subsets (BFS-style generation)

    Build subsets, permutations, and combinations by extending prior results. Builds on Tree DFS.

  • Dynamic Programming (1-D & 2-D)

    Solve each state once from smaller states over a sequence or grid. Builds on Tree DFS.

Tier 5

  • Two Heaps

    A max-heap and a min-heap split a stream to track its median. Builds on Top K Elements.

  • K-Way Merge

    A min-heap of list heads merges k sorted sources in O(N log k). Builds on Top K Elements.

  • Graph BFS/DFS

    Explore a graph by levels or branches with a visited set. Builds on Tree BFS.

  • Backtracking

    Search a decision tree, undoing each choice that fails. Builds on Subsets (BFS-style generation).

  • 0/1 Knapsack (DP)

    Take or skip each item under a capacity, tabulated by item and budget. Builds on Subsets (BFS-style generation) and Dynamic Programming (1-D & 2-D).

Tier 6

  • Topological Sort

    Order a DAG so every edge points forward, by in-degree or post-order. Builds on Graph BFS/DFS.

  • Union-Find (DSU)

    Disjoint sets with path compression answer connectivity in near O(1). Builds on Graph BFS/DFS.