LeetCode Patterns: All 22 Coding Interview Patterns

There are thousands of LeetCode problems and a much smaller number of ways to solve them. A pattern is the reusable half: the data structure, the loop shape and the invariant that make a family of problems collapse into one. Learn the pattern and you stop solving problems one at a time — which is the only strategy that scales, because no amount of memorising covers the specific problem you get asked.

Problems covered
2,565
Easy
558
Medium
1,407
Hard
600

Every pattern, one page each

Each hub below is a full page: what the pattern is, when it applies, a Python template, the time and space complexity with the reason behind it, and every problem in this library the pattern covers, grouped by difficulty.

They are numbered in the order to learn them: the hash map and the two array scans built on it first, then the stack, sorting and search, the linked structures and the graph walks, and the specialist techniques last. Counts are computed from the dataset, so they are what each page actually lists.