Problem sets
A curated list is only useful if each problem teaches something the previous ones did not. This file maps
the canonical lists onto the patterns in Algorithm patterns,
Graphs and trees and Dynamic programming, so you
practise a pattern rather than accumulating solved problems.
It also starts with what interviews actually look like now, because “grind 500 problems” is 2019 advice
and the format has moved.
Table of contents
1. What technical interviews look like in 2026
Worth reading before you pick a list, because it changes what to optimize for. The consistent themes
across current write-ups (see Sources — and note that much of this is practitioner
observation rather than published data):
- Algorithm rounds still exist at large companies, but grinding alone is no longer sufficient. The
same patterns are tested; the questioning around them got harder.
- Live coding has been made AI-resistant in three ways: broken code you must debug and fix, real-time
“why this data structure and not that one” probing, and collaborative framing where the interviewer
changes the requirements mid-problem to see how you adapt.
- A new “AI-assisted” round exists at some companies: you are given the tools and evaluated on
judgement — what you delegate, what you verify, whether you can defend the generated design. Take-home
exercises now often expect AI use and ask you to justify the choices.
- System design moved earlier. What used to be a senior-only round now appears at mid-level and
occasionally new-grad, because it is harder to fake.
- Behavioural rounds got heavier and more structured — specific stories, measurable outcomes,
follow-up probes.
- Onsites came back at some companies, partly because remote rounds were being gamed.
What this means for your prep, given that the thing you are rusty on is fundamentals:
| Old habit | Better use of the same hour |
|---|
| Solve a new problem, read the answer, move on | Solve one problem, then explain the invariant out loud, then do one variant from memory |
| Optimize for problem count | Optimize for pattern coverage plus the ability to derive complexity unprompted |
| Memorize solutions | Memorize templates (sliding window, binary search on the answer, DFS with memo) and re-derive the rest |
| Skip the “why” | Practise the sentence “I chose a heap here because I only need the extremum, not the order” — that sentence is the signal now |
| Only write code | Practise reading broken code and finding the bug. This is an actual round now |
The corollary that matters for someone who has been vibecoding: the parts an AI does well for you (typing
out a known algorithm) are the parts that are now least valued in the room, and the parts it cannot do
for you (choosing, justifying, adapting, debugging live) are the parts being tested harder. That is
good news — it means fluency in fundamentals is worth more, not less.
2. Which list, and how to use it
| List | Count | Difficulty split | Origin | Best for |
|---|
| Blind 75 | 75 | 14 E / 49 M / 12 H | Amazon engineer, 2020, posted anonymously on Blind | Under three weeks. Hits every major pattern once — the fastest route to pattern recognition |
| LeetCode 75 | 75 | 6 E / 53 M / 16 H | LeetCode’s own 2022 study plan | Same role as Blind 75, slightly more medium-heavy, integrated tooling |
| NeetCode 150 | 150 | 21 E / 90 M / 39 H | ex-Google engineer; superset of Blind 75 | Three to six weeks. 3-15 problems per pattern instead of one, so the pattern actually sticks |
| NeetCode 250 | 250 | — | expanded further | More than six weeks, or targeting a company known for hard rounds |
| Grind 75 | configurable | — | ex-Meta engineer; generates a schedule from your available hours | When you want the schedule decided for you |
All of them organize around the same ~14 patterns, which are the ones in
Algorithm patterns §1. The lists differ in
depth per pattern, not in coverage.
The honest recommendation for your situation (experienced, rusty on fundamentals rather than new to
them): do not start with a list at all. Start with the implement-from-scratch drills in section 6 —
you will recover far more per hour by rebuilding a heap, a trie and a DSU than by solving three medium
problems. Then work section 3 for coverage, and only go to NeetCode 150/250 for depth on the patterns
that still feel slow.
The rule that makes any list work: solve, then re-solve from a blank file the next day. Pattern
recognition comes from retrieval, not from reading solutions. That is what the spaced-repetition schedule
in the study plan is for.
3. The core 80, by pattern
One or two problems per pattern, chosen so that each teaches a distinct technique. This is roughly
Blind 75 reorganized so the pattern is the unit, plus a few additions where Blind 75 has a gap. Each
row names the transferable idea, which is the thing to be able to state after solving it.
Arrays and hashing
| Problem | The transferable idea |
|---|
| Two Sum | complement lookup in a hash map; O(n) instead of O(n^2) |
| Contains Duplicate | set membership as the default de-duplication move |
| Valid Anagram | Counter equality / frequency map |
| Group Anagrams | a canonical key (sorted string, or a 26-tuple) as the grouping key |
| Top K Frequent Elements | count then heap of size k, O(n log k) |
| Product of Except Self | prefix from the left, suffix from the right, no division |
| Encode and Decode Strings | length-prefixed encoding is delimiter-safe |
| Longest Consecutive Sequence | set membership turns an O(n log n) sort into O(n) |
Two pointers
| Problem | The transferable idea |
|---|
| Valid Palindrome | converging pointers with skip conditions |
| Two Sum II (sorted input) | the “one move is always safe” argument |
| 3Sum | fix one, two-pointer the rest; dedup at two places |
| Container With Most Water | move the shorter side — the exchange argument |
| Trapping Rain Water | two pointers carrying running maxima, O(1) space |
| Remove Duplicates from Sorted Array | read cursor + write cursor for in-place compaction |
| Sort Colors | three-way partition (Dutch national flag) |
Sliding window
| Problem | The transferable idea |
|---|
| Best Time to Buy and Sell Stock | running minimum; the degenerate one-state DP |
| Longest Substring Without Repeating Characters | jump start past the last occurrence, do not step |
| Longest Repeating Character Replacement | window - maxfreq <= k, and why stale maxfreq is safe |
| Permutation in String | fixed-size window with a frequency match |
| Minimum Window Substring | shrink-while-valid for a minimum; surplus counts go negative |
| Sliding Window Maximum | monotonic deque; each index pushed and popped once |
| Minimum Size Subarray Sum | shrink-while-valid, and why negatives break it |
Stack
| Problem | The transferable idea |
|---|
| Valid Parentheses | stack as a matcher; map closing to opening |
| Min Stack | a parallel stack of running minima gives O(1) min |
| Evaluate Reverse Polish Notation | stack machine evaluation |
| Generate Parentheses | backtracking with a validity invariant instead of generate-and-filter |
| Daily Temperatures | monotonic stack; the pop is when you learn the answer |
| Car Fleet | sort by position, then a monotonic stack of arrival times |
| Largest Rectangle in Histogram | monotonic stack + sentinel to flush it |
Binary search
| Problem | The transferable idea |
|---|
| Binary Search | pick one template and always write it |
| Search a 2D Matrix | treat the matrix as a flat sorted array |
| Koko Eating Bananas | binary search the answer with a monotone feasibility predicate |
| Find Minimum in Rotated Sorted Array | compare to a[hi], not a[lo] |
| Search in Rotated Sorted Array | one half is always sorted; decide which |
| Time Based Key-Value Store | bisect over timestamps |
| Median of Two Sorted Arrays | search the partition point, with +/-inf sentinels |
Linked list
| Problem | The transferable idea |
|---|
| Reverse Linked List | three-pointer iterative reversal |
| Merge Two Sorted Lists | dummy head removes the first-node special case |
| Reorder List | find middle + reverse second half + interleave |
| Remove Nth Node From End | open a gap of n, then walk both |
| Copy List With Random Pointer | a map from old node to new node (or the O(1)-space interleave trick) |
| Add Two Numbers | carry propagation with a dummy head |
| Linked List Cycle | Floyd’s tortoise and hare |
| Find the Duplicate Number | Floyd on the index -> value functional graph |
| LRU Cache | hash map + doubly linked list, O(1) both operations |
| Merge K Sorted Lists | heap of size k, O(n log k) |
Trees
| Problem | The transferable idea |
|---|
| Invert Binary Tree | the shape of every simple tree recursion |
| Maximum Depth of Binary Tree | both the recursive and the level-order form |
| Diameter of Binary Tree | return the height, accumulate the answer separately |
| Balanced Binary Tree | a -1 sentinel turns O(n^2) into O(n) |
| Same Tree / Subtree of Another Tree | structural comparison; hashing subtrees for the follow-up |
| Lowest Common Ancestor of a BST | walk down while both targets are on the same side |
| Binary Tree Level Order Traversal | snapshot the level size before appending children |
| Binary Tree Right Side View | last node of each BFS level |
| Count Good Nodes in Binary Tree | pass an accumulator down (pre-order) |
| Validate Binary Search Tree | in-order monotonicity, or (lo, hi) bounds |
| Kth Smallest Element in a BST | in-order with a counter, or subtree sizes for O(h) |
| Construct Binary Tree from Preorder and Inorder | why those two determine the tree |
| Binary Tree Maximum Path Sum | clamp negative branches to 0; the path can bend |
| Serialize and Deserialize Binary Tree | pre-order with explicit null markers |
Tries
| Problem | The transferable idea |
|---|
| Implement Trie | the structure itself |
| Design Add and Search Words (wildcards) | DFS over children when the pattern char is . |
| Word Search II | walk the board and the trie in lockstep; prune on invalid prefix |
Heap / priority queue
| Problem | The transferable idea |
|---|
| Kth Largest Element in a Stream | min-heap of size k |
| Last Stone Weight | max-heap via negation in Python |
| K Closest Points to Origin | heap vs quickselect trade-off |
| Kth Largest Element in an Array | quickselect O(n) expected vs heap O(n log k) |
| Task Scheduler | greedy with a closed-form answer, or a heap simulation |
| Find Median from Data Stream | two heaps with a balance invariant |
Backtracking
| Problem | The transferable idea |
|---|
| Subsets | include/exclude, and remembering to copy |
| Combination Sum | reuse allowed -> recurse on i, not i+1 |
| Permutations | swap into position, undo after |
| Subsets II / Combination Sum II | sort, then skip duplicate siblings (i > start) |
| Word Search | in-place visited marking |
| Palindrome Partitioning | backtracking with a precomputed palindrome table |
| N-Queens | pruning with three sets (columns and the two diagonal families) |
Graphs
| Problem | The transferable idea |
|---|
| Number of Islands | grid DFS/BFS with in-place marking |
| Clone Graph | a visited map from original to copy |
| Pacific Atlantic Water Flow | reverse the direction and BFS from the borders |
| Surrounded Regions | mark from the boundary, then flip the rest |
| Rotting Oranges | multi-source BFS by levels |
| Course Schedule | cycle detection = topological sort feasibility |
| Course Schedule II | the order itself (Kahn, or reverse DFS post-order) |
| Redundant Connection | union-find; the first edge that joins two connected nodes |
| Number of Connected Components | DSU or repeated traversal |
| Word Ladder | BFS with lazily-built wildcard adjacency |
| Network Delay Time | Dijkstra |
| Cheapest Flights Within K Stops | Bellman-Ford bounded to k+1 relaxation rounds |
| Min Cost to Connect All Points | MST (Prim on a dense graph) |
| Alien Dictionary | topological sort on a derived precedence graph |
| Reconstruct Itinerary | Hierholzer’s Eulerian path |
1D dynamic programming
| Problem | The transferable idea |
|---|
| Climbing Stairs | the base case of the whole topic |
| Min Cost Climbing Stairs | the same recurrence with a cost |
| House Robber / House Robber II | two running states; circular via two linear runs |
| Longest Palindromic Substring | expand around 2n-1 centers |
| Palindromic Substrings | the same expansion, counting |
| Decode Ways | look back one and two characters |
| Coin Change | unbounded knapsack, minimize |
| Maximum Product Subarray | carry both the max and the min |
| Word Break | dp over prefixes, membership in a set |
| Longest Increasing Subsequence | O(n^2), then the O(n log n) patience version |
| Partition Equal Subset Sum | subset-sum reachability (bitset in Python) |
2D dynamic programming
| Problem | The transferable idea |
|---|
| Unique Paths | the simplest grid DP; rolling row |
| Longest Common Subsequence | the two-sequence template |
| Best Time to Buy and Sell Stock with Cooldown | state machine DP |
| Coin Change II | combinations vs permutations, decided by loop order |
| Target Sum | reduce a +/- assignment to subset-sum counting |
| Interleaving String | two pointers as a 2D DP |
| Longest Increasing Path in a Matrix | memoized DFS when the order is implicit |
| Distinct Subsequences | 1D with a backward loop |
| Edit Distance | three choices: replace, insert, delete |
| Burst Balloons | interval DP; think about the last operation |
| Regular Expression Matching | DP with * handling; the classic hard one |
Greedy
| Problem | The transferable idea |
|---|
| Maximum Subarray | Kadane |
| Jump Game / Jump Game II | furthest reach; BFS-by-levels as a scan |
| Gas Station | total feasibility plus a local reset |
| Hand of Straights | greedy from the smallest remaining card |
| Merge Triplets to Form Target | filter then union |
| Partition Labels | extend to the last occurrence |
| Valid Parenthesis String | track a min/max open range |
Intervals
| Problem | The transferable idea |
|---|
| Insert Interval | three phases: before, merge, after |
| Merge Intervals | sort by start, extend with max |
| Non-overlapping Intervals | sort by end — the exchange argument |
| Meeting Rooms / Meeting Rooms II | max concurrency via heap or sweep line |
| Minimum Interval to Include Each Query | offline: sort queries, heap by length |
Bit manipulation and math
| Problem | The transferable idea |
|---|
| Single Number | XOR cancels pairs |
| Number of 1 Bits | n & (n-1) clears the lowest set bit |
| Counting Bits | dp[i] = dp[i>>1] + (i&1) |
| Reverse Bits | shift-and-accumulate |
| Missing Number | Gauss sum or XOR |
| Sum of Two Integers | XOR is sum-without-carry, (a&b)<<1 is the carry |
| Rotate Image | reverse rows then transpose |
| Spiral Matrix | four boundaries, or peel-and-rotate |
| Set Matrix Zeroes | use row 0 / column 0 as markers for O(1) space |
| Pow(x, n) | fast exponentiation by squaring |
| Happy Number | Floyd’s cycle detection on a functional graph |
4. The second 70: pattern depth
Once every row in section 3 is comfortable, the value is in variations — the same pattern where a small
change in the problem forces a change in the technique. This is what NeetCode 150/250 adds over
Blind 75, and it is where pattern recognition becomes automatic.
| Pattern | Variations worth doing, in order |
|---|
| Sliding window | Longest Substring with At Most K Distinct; Fruit Into Baskets; Subarrays with K Different Integers (the “exactly K = at most K minus at most K-1” trick); Count Number of Nice Subarrays; Max Consecutive Ones III; Sliding Window Median (needs a sorted structure) |
| Two pointers | 4Sum; 3Sum Closest; Boats to Save People; Squares of a Sorted Array; Longest Mountain in Array |
| Binary search on the answer | Split Array Largest Sum; Capacity To Ship Packages; Minimum Number of Days to Make m Bouquets; Magnetic Force Between Two Balls; Find K-th Smallest Pair Distance; Kth Smallest Element in a Sorted Matrix |
| Monotonic stack | Sum of Subarray Minimums (contribution counting); Maximal Rectangle; Remove K Digits; 132 Pattern; Next Greater Element II (circular); Online Stock Span |
| Prefix sums | Subarray Sum Equals K; Subarray Sums Divisible by K; Contiguous Array; Range Sum Query 2D; Corporate Flight Bookings (difference array); Car Pooling |
| Heap | Reorganize String; Minimum Cost to Hire K Workers; IPO; Sliding Window Median; Smallest Range Covering K Lists; Design Twitter |
| Union-find | Accounts Merge; Number of Provinces; Satisfiability of Equality Equations; Most Stones Removed; Smallest String With Swaps; Number of Islands II (online) |
| Topological sort | Minimum Height Trees; Sequence Reconstruction; Parallel Courses; Sort Items by Groups Respecting Dependencies |
| Shortest path | Path With Minimum Effort (binary search + BFS, or Dijkstra on max-edge); Swim in Rising Water; Path with Maximum Probability; Minimum Obstacle Removal (0-1 BFS); Cheapest Flights (Bellman-Ford) |
| Tree DP | House Robber III; Distribute Coins in Binary Tree; Binary Tree Cameras; Longest Univalue Path; Sum of Distances in Tree (rerooting) |
| Interval DP | Minimum Cost to Merge Stones; Strange Printer; Remove Boxes; Minimum Score Triangulation |
| Bitmask DP | Partition to K Equal Sum Subsets; Shortest Path Visiting All Nodes; Number of Ways to Wear Different Hats; Minimum Incompatibility; Maximum Students Taking Exam |
| Digit DP | Count Numbers with Unique Digits; Numbers At Most N Given Digit Set; Non-negative Integers without Consecutive Ones; Count of Integers |
| Design | LRU Cache; LFU Cache; Design Twitter; Insert Delete GetRandom O(1); Design Hit Counter; Snapshot Array; Time Based Key-Value Store; Design Search Autocomplete |
| Matrix | Game of Life (in-place with bit encoding); Diagonal Traverse; Toeplitz Matrix; Rotate Image; Word Search II |
| Strings | Repeated Substring Pattern (KMP failure function); Shortest Palindrome (KMP on s + rev(s)); Longest Duplicate Substring (binary search + rolling hash); Minimum Window Subsequence |
The “exactly K = atMost(K) - atMost(K-1)” reduction in the sliding-window row is worth calling out —
it converts a problem the window cannot solve directly into two problems it can, and it generalizes to a
surprising number of counting questions.
5. Language-specific practice
Problems whose point is a language feature rather than an algorithm. These are the ones that make the
difference between “knows algorithms” and “writes idiomatic TypeScript / Python”.
TypeScript and JavaScript
| Drill | What it tests | Reference |
|---|
Implement Promise from scratch, passing a small test suite | thenable adoption, single settlement, microtask ordering | JS core §6.5 |
Implement Promise.all, allSettled, any, race | combinator semantics and error behaviour | JS core §6.4 |
Implement bind, call, apply | this, the new case, prototype chain | JS core §12.1 |
Implement map, filter, reduce on Array.prototype | holes (i in this) and the empty-with-no-initial TypeError | same |
| Deep clone with cycles; deep equal | WeakMap/Map memo, Reflect.ownKeys, descriptors | same |
debounce (leading/trailing) and throttle | closures, timers, this forwarding | JS core §4.5 |
Bounded-concurrency pMap with retries | promise pooling, order preservation, error policy | JS core §6.8 |
Typed EventEmitter from an event map | mapped types, conditional rest parameters | TS types §11.2 |
DeepPartial, UnionToIntersection, Paths<T> | conditional/mapped/template-literal types | TS types §10 |
| Predict-the-output event loop puzzles | microtasks, nextTick, setImmediate ordering | JS core §6.3 |
| Explain why one loop is 4x slower than another | inline caches, packed vs holey arrays | JS core §8 |
Python
| Drill | What it tests | Reference |
|---|
| Write a decorator with arguments, then stack two | three-level closures, functools.wraps, order | Patterns §3.3 |
| Write a context manager both ways | __enter__/__exit__, suppression, @contextmanager | Patterns §3.4 |
Write a descriptor that validates, and a mini property | the attribute lookup order | Python core §3.2 |
Predict the MRO of a diamond, and what super() resolves to | C3 linearization | Python core §3.3 |
| Demonstrate the GIL with threads vs processes | what the GIL protects | Python core §6.2 |
| Make a generator pipeline that never materializes a list | laziness, yield from | Python core §4.2 |
| Build a priority queue with tie-breaking on unorderable payloads | the (priority, counter, item) idiom | Py data structures §7 |
Use bisect to answer floor / ceil / rank / count | left vs right semantics | Py data structures §8 |
Explain when s += x in a loop is linear and when it is quadratic | CPython’s in-place resize optimization | Complexity §9.3 |
| Convert a recursive solution to iterative for n = 1e5 | the 1000-frame recursion limit | Complexity §4.1 |
Write a match-based state machine over frozen dataclasses | structural pattern matching, immutability | Patterns §3.14 |
6. Implement-from-scratch drills
Do these before the problem lists. Each one is 15-40 minutes, and each rebuilds a specific piece of
machinery you will otherwise fumble under pressure. Do them in both languages at least once; do the
starred ones in both languages every review cycle.
| # | Drill | Target time | Reference |
|---|
| 1 | Dynamic array with growth, and state the amortized proof * | 15 min | TS §7 / Py §12 |
| 2 | Singly linked list + reverse, cycle detect, merge, middle * | 25 min | TS §8 / Py §13 |
| 3 | Ring-buffer queue and a two-stack queue | 20 min | TS §10 / Py §14 |
| 4 | Hash table: chaining, then open addressing with tombstones | 40 min | TS §12 / Py §15 |
| 5 | Binary min-heap with sift up/down and O(n) heapify * | 25 min | TS §13 / Py §16 |
| 6 | Median finder with two heaps | 15 min | same |
| 7 | BST insert/delete (all 3 cases) + iterative in-order * | 30 min | TS §14 / Py §17 |
| 8 | AVL insert with all four rotation cases | 40 min | TS §15 / Py §18 |
| 9 | Trie: insert / search / startsWith / autocomplete * | 25 min | TS §16 / Py §19 |
| 10 | Union-Find with path compression and union by size * | 15 min | TS §17 / Py §20 |
| 11 | LRU cache, both the map trick and the linked-list version * | 25 min | TS §19 / Py §22 |
| 12 | Segment tree (sum + min) and a Fenwick tree | 40 min | TS §20 / Py §23 |
| 13 | Merge sort, quicksort with random pivot, heapsort * | 35 min | Sorting §3-5 |
| 14 | Binary search: exact, lower_bound, upper_bound, first-true * | 20 min | Sorting §10 |
| 15 | Quickselect | 15 min | Sorting §9 |
| 16 | BFS + DFS (iterative) + topological sort both ways * | 30 min | Graphs §2, §4 |
| 17 | Dijkstra with lazy deletion, then with decrease-key | 30 min | Graphs §6 |
| 18 | Kruskal and Prim | 25 min | Graphs §7 |
| 19 | Bloom filter with the sizing formula | 20 min | TS §22 / Py §25 |
| 20 | Promise from scratch (JS) / a decorator with arguments (Py) * | 30 min | JS §6.5 / Py patterns §3.3 |
Every one of these has a tested reference implementation in this guide, so you can diff your version
against something that provably runs.
7. Debug-and-fix and code-review drills
A real round now. Practise by writing the bug yourself and fixing it a day later, or by reviewing code
that contains one of these classic defects. Each of these is a bug from the measured sections of this
guide, so you know the failure mode is real.
| Snippet | The bug | Why it is subtle |
|---|
BFS with queue.pop(0) / arr.shift() | O(n) dequeue makes the whole traversal O(V^2) | correct output, 145x slower at n=32k |
s += chunk in a Python loop where another name holds s | quadratic instead of linear | the same code is linear when the refcount is 1 |
[[0]*n]*m grid | every row is the same list | only shows up when you mutate |
arr.sort() on numbers in JS | lexicographic ordering | [1,10,9] looks almost sorted |
if x: where 0 is a valid value | falsy-value bug | works until the data contains 0 or '' |
def f(x, acc=[]) | shared mutable default | works on the first call |
| Marking visited on dequeue in BFS | queue grows to O(E), duplicates processed | still correct, just slow |
dp[c-w] with a forward capacity loop in 0/1 knapsack | items reused | passes the small example |
Missing seen[0] = 1 in prefix-sum counting | misses subarrays starting at index 0 | off by exactly the easy cases |
i > 0 instead of i > start in dedup backtracking | skips legitimate repeats | wrong count only for some inputs |
| Validating a BST against immediate children only | [10,5,15,null,null,6,20] passes | the standard example does not catch it |
| Dijkstra with a negative edge | silently wrong answer | no error, no crash |
Floyd-Warshall with k in an inner loop | wrong for some graphs | right for many test cases |
delete arr[i] on a hot JS array | permanent deoptimization | 40% slower forever, invisible in the output |
| Bloom filter index computed with signed 32-bit overflow | false negatives | breaks the one guarantee the structure makes |
Object.assign where descriptors matter | getters invoked, readonly lost | looks like a copy |
except: bare | swallows KeyboardInterrupt and CancelledError | tests pass, production hangs |
@lru_cache on a method | leaks every self forever | memory grows slowly |
for await over an array of promises | fully sequential | correct results, N times slower |
| Mutating a list while iterating it forward | skipped elements | silently drops data |
The exercise is not just “find the bug” — it is “say what the failure mode is, how you would have caught
it, and what test you would add”. That is what the round is actually scoring.
8. How to practise one problem properly
flowchart TD
A["1. Restate problem +<br/>ask clarifying questions"] --> B["2. State brute force<br/>and its complexity"]
B --> C["3. Name the pattern<br/>and why"]
C --> D["4. State the invariant<br/>before coding"]
D --> E["5. Write it<br/>(narrate only the interesting lines)"]
E --> F["6. Trace a small example,<br/>including an edge case"]
F --> G["7. State time/space<br/>and the bottleneck"]
G --> H["8. Close the file"]
H -.->|"next day, from a<br/>blank file"| A
The difference between an hour that builds fluency and an hour that does not:
- Restate the problem and ask two clarifying questions before writing anything. Input size? Sorted?
Duplicates? Negative values? In-place allowed? This is now explicitly scored — “more emphasis on
clarifying questions before coding” is one of the documented 2026 shifts.
- Say the brute force and its complexity out loud, even when it is obviously too slow. It establishes
a baseline and often reveals the redundancy the real solution removes.
- Name the pattern and why. “Contiguous subarray plus a monotone constraint, so sliding window.”
- State the invariant before coding. “The window
[left, right] always contains at most k distinct
characters.” Bugs come from not having one.
- Write it. Talk through the interesting lines only; narrating a
for loop wastes the room’s time.
- Trace one small example by hand, including an edge case (empty, single element, all equal).
- State time and space, and where the bottleneck is. Volunteer the follow-up: “the n log n is only
the sort; if the input arrived sorted this is linear.”
- Then, away from the interview: close the file and rewrite the solution from scratch the next day.
Retrieval is what builds the reflex; re-reading a solution builds only recognition.
Two habits worth adopting specifically because of how interviews changed:
- Defend a data-structure choice unprompted. “I’m using a
Map here rather than an object because the
keys are dynamic, and a plain object used as a dictionary goes into slow mode anyway.” That sentence is
the differentiator now.
- Practise being interrupted. Have a friend or a model change the requirements halfway (“now the input
is streaming”, “now the values can be negative”, “now it has to be O(1) space”) and adapt out loud. The
collaborative-framing round is exactly this.
Track your progress by pattern confidence, not problem count. A simple table with the 14 patterns and a
1-5 confidence score, updated weekly, tells you what to practise next far better than a streak does. The
study plan has a version of that table plus the review schedule.
9. Sources
Facts about list composition and the 2026 format shift come from:
Next: Cheat sheets for the quick reference, or
Study plan and flashcards to schedule the work.