Day 85 — Mock: DSA + System Design III

80 minutes · mock day · 60-minute DP block + Rate Limiter review

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

  1. 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.
  2. 0:02-0:05: answer the warm-up MCQs. Read explanations only for misses. Solving starts when the five-minute box ends.
  3. 0:05: start one strict 60-minute DSA timer using the mock-day protocol: timer first, talk first, code second.
  4. 0:05-0:35: solve Problem 1. Before code, say state, transition, base case, answer location, brute force, better complexity, and space.
  5. 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.
  6. 1:05-1:15: review Rate Limiter aloud: key, budget, shared store, atomic check-and-spend, token bucket, sliding window, fail-open versus fail-closed.
  7. 1:15-1:20: score the self-check gate. Failed DSA problems go to the next revision list with one WA: <root cause> line.

The problem menu

Pick exactly two. For each chosen problem, explain the DP invariant aloud before typing.

ProblemPattern nameSlot
Climbing Stairs DP I: the four questions 30 min
House Robber DP II: take it or skip it 30 min
Coin Change DP III: fewest coins 30 min
Longest Increasing Subsequence DP IV: longest increasing subsequence 30 min
Partition Equal Subset Sum DP V: 0/1 knapsack 30 min
Longest Common Subsequence DP VI: two strings, one grid 30 min
Edit Distance DP VII: edit distance 30 min
Decode Ways DP VIII: Counting With Constraints 30 min
Word Break DP IX: Segmentable Prefixes 30 min
Burst Balloons DP X: interval DP 30 min

Warm-up MCQs

1. Which line is the DP four-question invariant?

2. In Coin Change, what marks an amount you cannot make yet?

3. For 0/1 subset DP, which sweep protects single-use items?

4. In LCS, when characters match, which move applies?

5. Which rule makes Decode Ways different from plain stairs?

6. Which rate-limiter answer handles controlled bursts with small state?

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.