Brief
You are preparing for coding interviews that grade one skill: recognizing which of ~20 patterns a problem is wearing and talking your way to a working solution under time pressure. This subject turns the NeetCode-150-shaped track into a protocol you can run without the site open — the order, the quotas, the spacing rule, and the constraint that makes practice transfer to the real interview.
Instructions
The pattern sequence
Clear the families in this order — each builds on the previous:
arrays & hashing → two pointers → sliding window → stack (incl. monotonic) → binary search → linked list → trees → tries → heaps / priority queues → backtracking → graphs (BFS/DFS, topological sort, Dijkstra, union-find) → 1-D DP → 2-D DP → greedy → intervals
Per pattern, the same three steps
- Build the structure once. Before the family's problems, implement its underlying structure/primitive from scratch, with tests and a short note on its complexity and failure modes: dynamic array and hash map (with collision handling) for arrays & hashing; a linked list; a BST and traversals (recursive and iterative); a trie; a min-heap; union-find for the graph family. Later families that reuse a structure (heaps in greedy, hashing everywhere) don't rebuild — that's the point of the order.
- N representative problems. Solve 5–10 problems per family (the NeetCode 150 roster is the default list): start with 2–3 easies, finish with mediums; include the family's signature variants (e.g. "binary search the answer", fast & slow pointers, top-K with a heap, interval merge/overlap). A family is not done until you can state why its move preserves correctness (why the window may shrink, why greedy is safe, what the DP subproblem is — in one sentence, before coding).
- The re-solve spacing rule. Any problem that beat you — no working solution in 30
minutes, or you read the solution — goes on the re-solve log with a date. Re-solve it
from a blank editor 3+ days later; if it beats you again, it re-enters the log at
7 days. A problem leaves the log only by being solved cold. Keep the log in
todos/orjournal/, not in the KB.
The session constraint
Every scored attempt runs interview-style: explain your approach aloud first — the pattern you suspect, the plan, the complexity — then code, with a 25-minute cap for the coding phase. Talking and coding silently past the cap both count as misses. First attempts get 20–30 minutes of hard thinking before any solution peek.
Constraints
- No editor autocomplete or AI assistance during attempts; whiteboard conditions.
- Order is not optional — no cherry-picking graph problems before the stack family is cleared.
- Solutions may be read only after an honest timed attempt, and reading one puts the problem on the re-solve log by definition.
Acceptance
Mapped one-to-one onto the exercise's milestones:
- Structures from scratch — dynamic array, hash map, min-heap, trie, and union-find each pass their tests and carry a written complexity/failure-modes note.
- Arrays & hashing → two pointers → sliding window — quota met per family, and for each solved problem you can state in one sentence why the pointer/window move is safe.
- Stack, binary search, linked list — quota met, including a monotonic-stack problem, a "binary search the answer" problem, and a fast & slow pointers problem.
- Trees, tries, heaps — traversals done both recursively and iteratively, a BST-invariant problem, a trie build-and-query problem, and a top-K via heap, all within quota.
- Graphs, intervals, greedy — BFS/DFS, a topological sort, and a Dijkstra problem solved; interval merge/overlap done; each greedy solution accompanied by its one-line safety argument.
- DP & backtracking — 1-D then 2-D DP with the subproblem stated in one sentence before coding each; permutations/subsets with pruning; the re-solve log is empty or every entry is inside its spacing window.
Related
- Interview-prep track — the exercise this is the subject of.
- NeetCode — the problem roster and video walkthroughs behind the syllabus.