DSA patterns

Interview problems repeat a small set of ideas. Learn the 114 patterns below and most new problems turn into "this is a sliding window" or "this is a BFS on a grid". Each pattern lists its practice problems, easiest first.

Arrays & Hashing

Moore's Voting Algorithm 2

Double Reversal Trick 2

Dutch National Flag 1

Elimination Recurrence 1

Fenwick Tree (BIT) 1

Stack

Monotonic Stack

Linked List

Recursion & Backtracking

Trees & BST

Heaps

Intervals

Tries

Graphs

DFS - Complement Trick 1

Eulerian Path (Hierholzer) 1

Candidate Elimination 1

Minimum Spanning Tree 1

Dynamic Programming

Alternate Selection / Pick / Not pick 2

2D DP - max/min of last row 3

Bit Manipulation

Design Data Structures