LINE 500 · 35 STOPS · 4 LANGUAGES
A code template for every stop.
The 500 curated problems run as one line of 35 topic stops. Each stop has a one-page cheat sheet: three key points, three common pitfalls and a runnable template in Python, C++, Java and Go.
More dots: more interview reports map onto the stop.
Linear Structures01–08
- Stop 01: In-place Arrays, interview heat 1 of 3Read/write pointers for in-place compaction
- Stop 02: Hashing, interview heat 1 of 3One-pass hash map lookup
- Stop 03: Strings, interview heat 1 of 3KMP prefix function
- Stop 04: Two Pointers, interview heat 2 of 3Variable-size sliding window
- Stop 05: Prefix & Ranges, interview heat 2 of 3Prefix sums with a hash count
- Stop 06: Binary Search, interview heat 1 of 3First true on a half-open range
- Stop 07: Stacks & Heaps, interview heat 3 of 3Monotonic stack: next greater element
- Stop 08: Greedy, interview heat 1 of 3Sort by end time, keep what fits
Lists & Trees09–13
- Stop 09: Linked Lists, interview heat 1 of 3Reverse in place, fast and slow pointers
- Stop 10: Tree Traversal, interview heat 1 of 3Level-order BFS
- Stop 11: Tree Paths, interview heat 1 of 3Return the one-sided gain, record the bent path globally
- Stop 12: Tree Building, interview heat 1 of 3Preorder picks the root, inorder splits the sides
- Stop 13: BST, interview heat 1 of 3Iterative inorder walks a BST in sorted order
Graphs14–18
- Stop 14: Grid Search, interview heat 2 of 3Multi-source BFS, one ring per step
- Stop 15: Union-Find, interview heat 1 of 3Union-find with path compression and union by size
- Stop 16: Topo Sort, interview heat 1 of 3Kahn's algorithm: dequeue zero in-degree nodes
- Stop 17: Shortest Paths, interview heat 1 of 3Dijkstra with a heap and lazy deletion
- Stop 18: Spanning TreesKruskal: sort the edges, join with union-find
Backtracking19–21
Dynamic Programming22–31
- Stop 22: DP Basics, interview heat 1 of 31-D DP with rolling variables
- Stop 23: Grid DP, interview heat 1 of 3Grid DP compressed to one row
- Stop 24: Knapsack, interview heat 1 of 30/1 knapsack backwards, unbounded forwards
- Stop 25: Subsequences, interview heat 1 of 3LIS with a tails array and binary search
- Stop 26: String DP, interview heat 1 of 3Two-string DP over prefixes
- Stop 27: Palindromes, interview heat 1 of 3Interval DP with the left end running backwards
- Stop 28: State Machines, interview heat 1 of 3Ending-at-i states: track both max and min
- Stop 29: Stock Trading, interview heat 1 of 3Three states: holding, cooling down, free
- Stop 30: Scheduling DPSort by end, binary search the last compatible job
- Stop 31: Tree & Game DP, interview heat 1 of 3Tree DP: each node returns (take, skip)
Design & Bits32–35
- Stop 32: Iterators, interview heat 1 of 3Lazy iterator: hasNext does the advancing
- Stop 33: Caches, interview heat 3 of 3LRU: hash map plus doubly linked list
- Stop 34: Trie & Codec, interview heat 1 of 3Trie nodes hold children and counts
- Stop 35: Bits & Math, interview heat 1 of 3Bit tricks and fast power