Weighting below reflects what Google actually asks, not generic FAANG distribution. Graphs, grids/matrices, and DP are over-represented. Google under-asks pure trivia (bit tricks, obscure string algorithms).
Rules for every problem:
- Restate the problem and ask ≥ 1 clarifying question.
- State brute force + its complexity before optimizing.
- Write in a plain doc. No running the code.
- State final time/space complexity unprompted.
- Trace one concrete example line by line.
- Log it in
05-practice-log.md, including why you missed it if you did.
1. Arrays, strings, two pointers, sliding window — High
- Two-pointer on sorted arrays; 3-sum family
- Fixed-window and variable-window sliding window
- Longest substring with constraint (at most K distinct, no repeats)
- Minimum window substring
- Prefix sums, prefix sum + hashmap (subarray sum equals K)
- In-place partition / Dutch national flag
- Cyclic sort / find missing & duplicate in O(1) space
2. Hashing & counting — High
- Frequency maps, anagram grouping
- Hashmap + auxiliary structure (design problems)
- Custom hash keys (tuples, normalized forms)
3. Binary search — High
- Exact, lower bound, upper bound — all three cold
- Search in rotated / partially sorted arrays
- Binary search on the answer (min capacity, min speed, split array) — Google’s favorite variant
- Binary search on a 2-D matrix
- Median of two sorted arrays
4. Stacks, monotonic stacks, queues — Medium
- Valid parentheses & variants
- Next greater / previous smaller element
- Largest rectangle in histogram; maximal rectangle
- Sliding window maximum (monotonic deque)
- Expression evaluation / basic calculator
5. Intervals & sweep line — Medium-High
- Merge intervals, insert interval
- Meeting rooms I/II (heap-based)
- Sweep line with event sorting (skyline problem)
- Interval scheduling / non-overlapping maximization
6. Heaps & top-K — Medium
- K largest / K closest / K frequent
- Merge K sorted lists
- Two-heap median maintenance
- Heap + hashmap for lazy deletion
7. Linked lists — Medium-Low
- Reverse (iterative + in groups of K)
- Fast/slow pointer: cycle detection, middle, cycle start
- Merge, partition, deep copy with random pointer
8. Trees — High
- All traversals, iterative versions included
- BFS by level, zigzag, right-side view
- LCA (with and without parent pointers)
- Path sum variants, diameter, max path sum
- Serialize / deserialize
- Validate BST, BST insert/delete, Kth smallest
- Tries: insert/search/prefix, word search with trie, autocomplete
9. Graphs — Very High (Google’s signature)
- BFS/DFS on adjacency list and on grids
- Multi-source BFS (rotting oranges, nearest exit)
- Connected components, flood fill, number of islands + variants
- Topological sort (Kahn’s + DFS), course schedule, alien dictionary
- Union-find with path compression + union by rank; accounts merge; redundant connection
- Dijkstra (heap), Bellman-Ford intuition, 0-1 BFS
- Bipartite check / graph coloring
- Shortest path on a grid with state (keys, obstacles you may remove, fuel) — very Google
- Word ladder (BFS on implicit graph)
10. Dynamic programming — Very High
- 1-D: climbing stairs family, house robber, decode ways, word break
- Knapsack: 0/1, unbounded, subset sum, partition equal subset
- LIS: O(n²) and O(n log n) patience sorting
- 2-D grid DP: unique paths, min path sum, dungeon game
- String DP: edit distance, LCS, regex matching, wildcard matching, palindrome partitioning
- Interval DP: burst balloons, matrix chain, stone game
- Bitmask DP: TSP-style, assignment problems
- DP on trees: house robber III, tree diameter via DP
11. Backtracking — Medium
- Subsets, permutations, combinations (with duplicate handling)
- N-Queens, Sudoku solver
- Word search in a grid (+ trie-accelerated word search II)
- Expression add operators
12. Greedy — Medium
- Interval scheduling, jump game I/II
- Gas station, task scheduler
- Always be able to state the exchange argument for why greedy is correct
13. Object/API design coding — Medium-High at L5
- LRU cache (hashmap + doubly linked list), LFU cache
- Design an iterator (flatten nested list, peeking iterator)
- Rate limiter (token bucket, sliding window log)
- In-memory KV store with TTL
- Design a file system / autocomplete system / Twitter feed
- Snapshot array, versioned map
14. Math & bits — Low, but cheap to cover
- Bit manipulation basics, single number variants
- Fast exponentiation, GCD
- Reservoir sampling, random with weights
- Overflow-safe arithmetic
Volume targets by end of Week 7
| Difficulty | Count | Cold solve rate at 25 min |
|---|---|---|
| Easy | ~20 (warm-ups only) | 100% |
| Medium | ~110 | ≥ 80% |
| Hard | ~35 | ≥ 40% |
Quality beats quantity. 100 problems where you can re-derive the solution a month later beats 400 you half-remember. If you hit the volume target but fail your Week 7 mocks, the problem is depth, not count.
Common L5 failure modes
- Jumping to code before scoping → looks like poor GCA.
- Silent thinking → interviewer can’t score you.
- Not handling edge cases until prompted → reads as junior.
- Getting the optimal solution but writing sloppy code → this alone can sink an L5 loop.
- Not proposing tests. Say “let me check n=0, single element, all duplicates.”
- Arguing with the interviewer’s hint instead of exploring it. Hints are scored — take them fast and gracefully.