Reading a Problem: Choosing the Right Tool
A repeatable triage for turning a wall of prose into 'oh, this is a monotonic stack'.
Practice — write these yourself
Every module ends with exercises. Write each one in the editor on its card and run it right here against the example, then copy the “Check my solution” prompt with your code into a fresh AI chat for a review. Reference solutions are behind a spoiler.
Triage three problems without coding
For each of these, write out triage steps 1–6 (no code). Identify the brute force, the wasted work, and the structure/pattern you'd reach for — plus the one phrase in the statement that gave it away.
- “Given an array of integers, return the length of the longest subarray whose elements sum to exactly
k. Values can be negative.1 ≤ n ≤ 2·10⁵.” - “You're given
nflights as(from, to, price)and a start city. Return the cheapest price to reach citytusing at mostkstops.” - “Return all subsets of a set of
ndistinct integers.1 ≤ n ≤ 16.”
Complexity from constraints
Write a Go function that, given n, prints your target complexity and one candidate technique. Hard-code the reasoning as a lookup so you internalise the table. Then explain, in a comment, why n = 100000 rules out an O(n²) solution but n = 2000 allows it.
// targetComplexity returns (bigO, technique) you should aim for// given only the maximum input size n.func targetComplexity(n int) (string, string)
The part an AI chat can't give you
An LLM will happily explain a monotonic stack — and you should let it. What it won't do is decide what you learn next, remember that you got something wrong three weeks ago, or put it back in front of you today. That machinery is the course.
Think in half-open ranges [i,j); no …
Real cards from the two free modules, scheduled by the same SM-2 code the course runs. Every module's key points become cards.
Review 12 cards, then continue 14 Backtracking.
The dashboard picks the one next thing, so you never open the course and wonder what to do.
- “sorted” + “find a pair”→Two pointers
- “longest substring…”→Sliding window
- “next greater element”→Monotonic stack
- “top k” / “k closest”→Heap
- “number of ways”→DP over states
Two full indexes map the phrases you actually see in a problem to the structure or building block they imply. Browse the DSA one free →
That's 3 of 81.
The rest of Data Structures & Algorithms, all of Broader CS, and the full System Design track — including 19 case studies you run as mock interviews — plus every exercise and the spaced-repetition review, are one payment away.
Already bought it? Unlock