Every engineer who has cracked FAANG interviews will tell you the same thing: the problems are not random. There are patterns. Once you see them, you stop dreading interviews and start recognizing familiar shapes in unfamiliar problems.

Here is the honest truth - you do not need to solve 800 problems. You need to deeply understand about 10 patterns and practice 5-8 problems per pattern. That is around 60-80 problems done right, not 500 done poorly.

The 10 Core Patterns

1. Sliding Window

Use when the problem involves a contiguous subarray or substring and you need to find some optimal value (max, min, longest, shortest).

Classic problems: Longest substring without repeating characters, Maximum sum subarray of size K, Minimum window substring.

The key insight: two pointers defining a window that expands and contracts based on a condition.

2. Two Pointers

Use when working with sorted arrays or when you need to find pairs or triplets that satisfy a condition.

Classic problems: Two Sum (sorted array), 3Sum, Container with most water, Remove duplicates from sorted array.

The key insight: start from both ends (or both at start) and move based on comparison logic.

3. Fast and Slow Pointers

Specifically for linked list problems. One pointer moves twice as fast.

Classic problems: Detect cycle in linked list, Find middle of linked list, Happy number.

Not just for sorted arrays. Anytime you can define a search space where half can be eliminated, binary search applies.

Classic problems: Search in rotated sorted array, Find first and last position, Koko eating bananas, Minimum in rotated sorted array.

5. BFS / Level Order Traversal

For shortest path problems and level-by-level tree traversal. Use a queue.

Classic problems: Binary tree level order traversal, Word ladder, Rotting oranges, Number of islands (can use BFS or DFS).

6. DFS / Backtracking

For exploring all possibilities, permutations, combinations, and path problems in trees/graphs.

Classic problems: Subsets, Permutations, Combination sum, N-Queens, Word search.

7. Tree Patterns (In/Pre/Post Order + Path Problems)

Most tree problems are either traversal variants or path problems. Learn both recursive and iterative versions.

Classic problems: Maximum path sum, Diameter of binary tree, Lowest common ancestor, Serialize and deserialize tree.

8. Dynamic Programming

The most feared pattern, but it comes in recognizable sub-patterns:

  • 1D DP: Climbing stairs, House robber
  • 2D DP: Unique paths, Longest common subsequence
  • Knapsack: 0/1 knapsack, Coin change
  • Interval DP: Burst balloons, Matrix chain multiplication

The key insight: define your state, find the recurrence relation, and decide top-down vs bottom-up.

9. Heap / Priority Queue

For problems involving “K largest,” “K smallest,” “K most frequent,” or streaming data.

Classic problems: Kth largest element, Merge K sorted lists, Task scheduler, Top K frequent elements.

10. Intervals

For scheduling, calendar, and range overlap problems.

Classic problems: Merge intervals, Insert interval, Non-overlapping intervals, Meeting rooms.

How to Actually Study These

Phase What to Do Time
Pattern Study Read the pattern theory, understand the template 30 min per pattern
Easy Problems Solve 2-3 easy problems per pattern without help 1-2 days per pattern
Medium Problems Solve 4-5 mediums, look at solution if stuck for 20+ min 3-4 days per pattern
Review Redo problems you got wrong without looking at notes 1 day per pattern

Total time with this structure: 6-8 weeks of focused prep, not 6 months of random grinding.

The Problems Most People Miss

Graphs deserve a special callout. Many engineers skip or rush graph problems. Cover these specifically:

  • Graph traversal (BFS/DFS on adjacency list)
  • Topological sort (course schedule pattern)
  • Union-Find (number of connected components)
  • Dijkstra’s algorithm (shortest path with weights)

These 4 graph sub-patterns show up constantly in senior-level interviews.

Red Flags in Your Study Approach

  • Solving problems by looking at the solution after 5 minutes. You need at least 20-30 minutes of real struggle.
  • Solving easy problems endlessly to feel productive. Mediums are where interviews actually live.
  • Learning syntax tricks without understanding why the pattern works.
  • Not timing yourself. Under interview pressure, speed matters.

The Pattern Recognition Trick

When you see a new problem, ask yourself:

  1. What data structure is the input? (array, string, tree, graph, matrix)
  2. What are we optimizing for? (max, min, count, yes/no)
  3. Do we need to explore all possibilities or find one optimal path?

Those three questions will get you to the right pattern 80% of the time.

Bottom Line

Leetcode is a game with patterns. Once you know the patterns, the game becomes much more manageable. Stop doing random problems and start doing deliberate, pattern-focused practice. Ten patterns, 60-80 problems, done deeply - that beats 500 problems done shallowly every time. +++