Blind 75 — Pattern Walkthrough

The famous list, reorganized by pattern with the key insight for each problem — so you learn 15 ideas, not 75 answers.

blind-75problem-listinterview-prep

The Blind 75: learn 15 patterns, not 75 answers

Imagine trying to learn chess by memorizing every famous game move-for-move. You'd do terribly against any player who deviated from those exact games. The right way is to learn strategic patterns — pin attacks, forks, endgame techniques — and then recognize when to apply them. The Blind 75 works the same way.

🎯 The insight: The Blind 75 (a Facebook engineer's curated list) endures because it's the minimal set covering nearly every pattern interviews draw from. Used wrong, it's 75 memorized solutions that evaporate under pressure. Used right, it's ~15 patterns, each seen from 3–6 angles — this page groups it that way, with the one-line insight per problem.

Protocol per problem: attempt 25–30 min cold → if stuck, read only the insight here and try again → solved or not, say the approach out loud in one sentence → log it for re-attempt in a week. Marking "solved" after reading a solution is the cardinal sin — re-derive days later, or it didn't happen.

Quick reference — pattern to time complexity

PatternTypical complexityKey data structure
Hash mapO(n) time, O(n) spaceHash table
Two pointersO(n) time, O(1) spaceSorted array
Sliding windowO(n) time, O(k) spaceWindow + hash/set
StackO(n) time, O(n) spaceStack
Binary searchO(log n) time, O(1) spaceSorted array
Linked list (fast/slow)O(n) time, O(1) spacePointers
Tree recursionO(n) time, O(h) spaceRecursion stack
BFSO(V+E) time, O(V) spaceQueue
HeapO(n log k) time, O(k) spacePriority queue
BacktrackingO(2^n) worstRecursion
DP (1-D)O(n) time, O(n) spaceArray
DP (2-D)O(m·n) time, O(m·n) spaceMatrix

Arrays & Hashing — hash tables, arrays

ProblemThe insight
Two Sumdict of seen values → complement lookup, one pass
Contains Duplicateset membership
Product of Array Except Selfprefix products × suffix products, no division
Maximum SubarrayKadane: running sum, reset when it goes negative (1-D DP in disguise)
Maximum Product Subarraytrack running max and min (negatives flip them)
Top K Frequentcount dict → bucket-by-frequency (or heap)
Group Anagramscanonical key: sorted word / letter counts
Valid Anagramcounting dict
Longest Consecutive Sequenceset + only start counting at left edges (x−1 absent)
Encode/Decode Stringslength-prefix framing — delimiters alone can't be safe
Python
# Two Sum — the hash map template
def two_sum(nums, target):
    seen = {}
    for i, x in enumerate(nums):
        if target - x in seen:
            return [seen[target - x], i]
        seen[x] = i
    return []

# Maximum Subarray — Kadane's algorithm
def max_subarray(nums):
    curr_sum = max_sum = nums[0]
    for n in nums[1:]:
        curr_sum = max(n, curr_sum + n)  # reset if negative prefix
        max_sum = max(max_sum, curr_sum)
    return max_sum
Java
// Two Sum in Java
import java.util.HashMap;
public class Solution {
    public int[] twoSum(int[] nums, int target) {
        HashMap<Integer, Integer> seen = new HashMap<>();
        for (int i = 0; i < nums.length; i++) {
            int partner = target - nums[i];
            if (seen.containsKey(partner))
                return new int[]{seen.get(partner), i};
            seen.put(nums[i], i);
        }
        return new int[]{};
    }
}
C++
// Two Sum in C++
#include <unordered_map>
#include <vector>
using namespace std;
vector<int> twoSum(vector<int>& nums, int target) {
    unordered_map<int, int> seen;
    for (int i = 0; i < (int)nums.size(); i++) {
        int partner = target - nums[i];
        if (seen.count(partner)) return {seen[partner], i};
        seen[nums[i]] = i;
    }
    return {};
}

Two Pointers — doc

ProblemThe insight
Valid Palindromeopposite ends, skip non-alphanumerics
3Sumsort; fix one, two-pointer the rest; skip duplicates carefully
Container With Most Watermove the shorter wall inward — exchange argument
Trapping Rain Waterwater[i] = min(maxL, maxR) − h[i]; two pointers carry the maxes

Sliding Window — doc

ProblemThe insight
Best Time to Buy/Sell Stockrunning min, best diff — window degenerates to one pass
Longest Substring Without Repeatingwindow + set; shrink from left past the repeat
Longest Repeating Character Replacementwindow valid while (size − maxFreq) ≤ k
Minimum Window Substringneed/have counts; expand right, shrink left greedily

Stack — doc

ProblemThe insight
Valid Parenthesesthe canonical LIFO match

Binary Search — doc

ProblemThe insight
Search Rotated Sorted Arrayone half is always sorted — decide which, recurse into the right one
Find Min in Rotated Sorted Arraycompare mid to right end; shrink toward the bend

Linked List — doc

ProblemThe insight
Reverse Linked Listthe three-pointer dance, from memory, both directions of asking
Merge Two Sorted Listsdummy head + two pointers
Reorder Listmiddle → reverse second half → interleave (three sub-skills)
Remove Nth From Endlead pointer n ahead, then move both
Linked List CycleFloyd fast/slow
Merge K Sorted Listsheap of k heads — O(N log k)

Trees — doc

ProblemThe insight
Max Depththe 3-line recursion template
Same Tree / Invert Treesimultaneous recursion / swap-and-recurse
Subtree of Another Treesame-tree check at every node
LCA of a BSTwalk from root until the targets split
Validate BST(low, high) bounds passed down — child-check fails
Level Order TraversalBFS queue, level = current queue length
Kth Smallest in BSTin-order traversal, count down
Construct from Preorder + Inorderpreorder[0] is root; inorder splits children
Binary Tree Max Path Sumpost-order: best one-leg path up vs best arch through
Serialize/Deserializepreorder with null markers
Python
# Tree max depth — the 3-line template every tree problem starts from
def max_depth(root):
    if not root:
        return 0
    return 1 + max(max_depth(root.left), max_depth(root.right))

# Level order traversal — BFS queue
from collections import deque
def level_order(root):
    if not root: return []
    result, queue = [], deque([root])
    while queue:
        level = []
        for _ in range(len(queue)):  # freeze current level size
            node = queue.popleft()
            level.append(node.val)
            if node.left: queue.append(node.left)
            if node.right: queue.append(node.right)
        result.append(level)
    return result
Java
// Tree max depth — Java
public int maxDepth(TreeNode root) {
    if (root == null) return 0;
    return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
}
C++
// Tree max depth — C++
int maxDepth(TreeNode* root) {
    if (!root) return 0;
    return 1 + max(maxDepth(root->left), maxDepth(root->right));
}

Tries — doc

ProblemThe insight
Implement Triechildren dict + end-flag
Word Search IItrie over dictionary guides grid backtracking — prune dead prefixes
Design Add & Search Words'.' wildcard → branch into all children (DFS)

Heap — doc

ProblemThe insight
Find Median from Data Streamtwo heaps: max-heap lower half, min-heap upper, rebalance

Backtracking — doc

ProblemThe insight
Combination Sumchoose/explore/un-choose; reuse allowed → don't advance index
Word Searchgrid DFS + mark/unmark visited

Graphs — doc

ProblemThe insight
Number of Islandsflood fill (BFS/DFS) per unvisited land cell
Clone Graphdict old→new while traversing
Pacific Atlantic Water Flowreverse-flow BFS from both oceans; intersect
Course Schedulecycle detection = topological sort (Kahn's / DFS colors)
Graph Valid Treeconnected + exactly n−1 edges (union-find)
Number of Connected Componentsunion-find counting, or DFS sweeps
Alien Dictionarybuild precedence edges from adjacent words → topo sort

Intervals — greedy + heaps

ProblemThe insight
Insert Intervalthree phases: before, merge-overlaps, after
Merge Intervalssort by start; extend or push
Non-overlapping Intervalsmax meetings kept (sort by end) → n − kept
Meeting Rooms I / IIoverlap check / heap of end times

1-D DP — doc

ProblemThe insight
Climbing StairsFibonacci — the hello-world recurrence
House Robber I / IItake[i] vs skip[i]; circular → run twice excluding one end
Coin Changemin coins per amount, bottom-up (the greedy-fails poster child)
Longest Increasing SubsequenceO(n²) DP, or patience trick with binary search O(n log n)
Word Breakdp[i] = any dp[j] && s[j:i] in dict
Decode Waysclimbing stairs with validity conditions
Palindromic Substrings / Longest Palindromic Substringexpand around 2n−1 centers

2-D DP & Strings

ProblemThe insight
Unique Pathsgrid[i][j] = top + left
Longest Common Subsequencematch → diag+1; else max(top, left)

The remainder (bit/math/matrix — appear less, finish last)

Set/Clear bits family (Number of 1 Bits, Counting Bits, Missing Number, Reverse Bits, Sum of Two Integers), Rotate Image (transpose + reverse rows), Spiral Matrix (shrink four boundaries), Set Matrix Zeroes (first row/col as markers).

The order that compounds

Do the groups top-to-bottom as listed — each reuses the previous (3Sum needs two pointers; trees need recursion comfort; graphs need BFS from trees; intervals need greedy). Two groups per week with re-attempts is a realistic 6-week pass; see the study plan for scheduling, then graduate to mock drills.

Think it through

Think it through: Pattern Speed Round: 3 Classic ProblemsFoundation — name the pattern before looking0/3 stages

PROBLEMTime yourself: for each of the three problems below, name the pattern and state the time/space complexity BEFORE revealing. (1) 'Climb to the top of a staircase with 1 or 2 steps at a time — how many distinct ways?' (2) 'Given n courses with prerequisites, determine if you can finish all courses.' (3) 'Find the length of the longest increasing subsequence in an array.'

  1. 1

    Climbing Stairs

    It's asking to count 'distinct ways' to reach a target. Choices compound. What does this remind you of?

  2. 2

    Course Schedule

    Courses depend on other courses. What happens if course A requires B, which requires A?

    unlocks after the stage above
  3. 3

    Longest Increasing Subsequence

    You're looking for a subsequence — elements don't need to be contiguous. The word 'longest' + 'subsequence' is a classic DP signal. State the recurrence.

    unlocks after the stage above

Interview perspective

Practice — climb the ladder

Practice ladder: Blind 75 Patterns0/13 solved

Climb in order — every rung assumes the one above it. Solve on LeetCode, then tick it here; progress is saved on this device.

Must-do first

these 5 cover 3 patterns — your minimum viable set
  1. Hash map complement lookup.

  2. One-pass running min — window in disguise.

  3. Stack — LIFO for nesting.

  4. Fibonacci DP — entry 1-D DP.

  5. Kadane's — reset when prefix goes negative.

Core group

cover the heavy-hitter patterns
  1. Bottom-up DP — the greedy-fails demo.

  2. BFS/DFS flood fill — connected components.

  3. Three-pointer linked list template.

  4. BFS on tree — queue + level size.

Stretch

compound and hard problems
  1. Min-heap of k heads — O(N log k).

  2. Trie pruning + backtracking grid search.

  3. Two-heap balance trick.

Practice

The page is the practice. Track group-by-group; when all groups are green twice, you're ready for mock drills — the last step before the real thing.

Check yourself — 75 problems, 15 patterns

Check yourself0/3 answered

1. The Blind 75's core value is teaching you to:

2. You've read solutions to 50 Blind 75 problems and feel confident. But in a mock interview you blank. What happened?

3. 'Binary Tree Max Path Sum' — you can go left subtree only, right subtree only, or through root. Which traversal builds this?

Visualize BFS level-order traversal

Unknown visualizer: bfs-tree