What are most common LeetCode patterns?
The LeetCode patterns that come up most often are Two Pointers, Sliding Window, Fast and Slow Pointers, Merge Intervals, Binary Search, Tree BFS, Tree DFS, Topological Sort, Backtracking, and Dynamic Programming. Between them they account for most of what coding interviews ask.
If you are starting out, learn these five first:
- Two Pointers, for sorted arrays and for questions that ask you to find a pair or a triplet.
- Sliding Window, for subarray and substring questions that carry a size or sum condition.
- Tree BFS and DFS, for nearly every tree and graph traversal question.
- Binary Search, for sorted input, and for any question asking for a smallest or largest value you can test.
- Dynamic Programming, for overlapping subproblems and for counting or optimization questions.
What matters is recognition rather than memorization. Once you can name the pattern behind a question, the template gives you the solution.
For the full list, the signal that identifies each pattern, and practice problems for every one, read our complete guide to LeetCode patterns.
Where to Go Next
Learning the patterns in order is more effective than solving random problems. The complete pattern guide maps each pattern to the questions it solves, explains how to recognize it, and lists problems you can practice on.

GET YOUR FREE
Coding Questions Catalog

$98

$98

$197