Tonight's goal: solve two dynamic-programming problems under a strict timer, then explain Rate Limiter trade-offs aloud: token bucket versus sliding window.
Tonight's protocol
0:00-0:02: choose exactly two DP problems from the menu below. If choice takes more than 60 seconds, use Coin Change and Longest Common Subsequence.
0:02-0:05: answer the warm-up MCQs. Read explanations only for misses. Solving starts when the five-minute box ends.
0:05: start one strict 60-minute DSA timer using the mock-day protocol: timer first, talk first, code second.
0:05-0:35: solve Problem 1. Before code, say state, transition, base case, answer location, brute force, better complexity, and space.
0:35-1:05: solve Problem 2 with the same spoken checkpoint. If stuck at minute 25 of either slot, read only the pattern name from the table and use the final five minutes.
“Every DP is four answers: what dp[i] means, how it comes from smaller states, the base case, and where the final answer lives. Here: ways(i) = ways(i-1) + ways(i-2).”
2. In Coin Change, what marks an amount you cannot make yet?
“dp[amount] = 1 + the minimum of dp[amount - coin] over every coin; amounts you can never make stay infinite.”
3. For 0/1 subset DP, which sweep protects single-use items?
“Ask ‘can some subset hit this exact target?’ where target = totalSum/2; each item is usable once, so sweep targets from high to low.”
4. In LCS, when characters match, which move applies?
“When characters match, extend the diagonal: dp[i][j] = dp[i-1][j-1] + 1; otherwise take the better of dropping one character from either string.”
5. Which rule makes Decode Ways different from plain stairs?
“Climbing stairs with a bouncer: a one- or two-digit step only counts when the chunk it consumes is a valid letter code (1-26, no leading zero).”
6. Which rate-limiter answer handles controlled bursts with small state?
“A rate limiter answers ‘has this key spent its budget in this window?’ — token bucket and sliding window are just different bookkeeping for the same budget.” Token bucket is the usual default for steady rate plus controlled bursts; sliding window is fairer near boundaries but costs more bookkeeping.
Self-check gate
Pass bar
Pass tonight if you score at least 1.5 out of 2 on DSA, say the DP four answers before both attempts, and explain Rate Limiter trade-offs in five minutes without notes.
Score each DSA problem: 1 for accepted inside its slot, 0.5 for the right invariant with unfinished code, 0 for the wrong direction.
Rate Limiter passes only if you can say: token bucket gives a steady rate with controlled bursts and O(1) state; sliding window is fairer near window boundaries but exact logs store more request data; both need atomic check-and-spend in the shared budget store.
Failure path: add every failed DSA problem to the next revision list with WA: <missed invariant or implementation bug>. If the Rate Limiter review fails, add Rate Limiter: token bucket vs sliding window trade-off to the next session's first five minutes.