Mock day · arrays · start solving within 5 minutes
Tonight's goal: choose a direction under pressure, say the pattern and complexity out loud, then code honestly under a timer.
Tonight's protocol
Use the mock-day process: speak first, code second, compare after.
0:00-0:03 — Warm up: answer the six MCQs below. Do not study; just retrieve.
0:03-0:05 — Choose the set: pick any 3 problems from the Day 1-5 menu. Include at least one problem that feels uncomfortable.
0:05-0:50 — Timed set: spend 10-15 minutes per problem. Before typing, say the pattern guess, brute force, better approach, and time/space complexity out loud.
During each timer: code without solution text. If stuck at minute 10, read only the pattern name in the menu, then keep trying until minute 15.
0:50-1:00 — Compare: for each miss, open the linked source lesson or solution and write one reasoning gap: invariant, edge case, or implementation bug.
1:00-1:25 — Mock review: choose 1 easy problem and 1 medium problem from the same menu. Explain your approach out loud before coding: 10 minutes for easy, 15 minutes for medium.
1:25-1:30 — Gate: apply the self-check below and put any failed problem into the next revision queue.
The problem menu
For the timed set, pick any 3. For mock review, pick one easy and one medium; the medium choices here are Maximum Subarray and Product of Array Except Self.
1. Two Sum asks for a missing partner while scanning. Which invariant applies?
The source invariant: “Hashing: trade O(n) space to make ‘have I seen X?’ an O(1) question.”
2. Stock profit: which fact must the scan keep so today's sell is easy?
The source invariant: “Best sell = today's price minus the cheapest price seen so far; one pass, carry the min.”
3. Maximum Subarray: what should happen when the carried sum turns negative?
The source invariant: “A running sum that has gone negative can never help a future subarray, so reset it: cur = max(x, cur+x).”
4. Product Except Self: what builds one answer cell without division?
The source invariant: “answer[i] = product of everything to the left times product of everything to the right; two sweeps, no division.”
5. Move Zeroes: which pointer story proves the pass is linear?
The source invariant: “A write pointer chases a read pointer; each moves forward only, so the whole pass is O(n).”
6. Find Pivot Index: what makes each split check O(1)?
The source invariant: “Precompute a running total once, then answer any range or split in O(1).”
Self-check gate
Pass tonight only if all four are true.
You started the first timed problem by minute 5.
For every attempt, you said the pattern, brute force, better approach, and complexity before coding.
At least 2 of the 3 timed-set problems reached runnable code inside 15 minutes each.
The mock review included 1 easy and 1 medium problem, each explained out loud before coding.
Failure path: write WA: <root cause> for each failed problem, add it to the next revision queue, and re-solve it later from a blank file with no hints.