~120 minutes · mock day · trees + notification system
Goal: run a strict 60-minute tree mock, then design a notification system from a blank page using the seven-step system-design script.
Tonight's protocol
Use the mock-day protocol: strict timer, talk out loud, approach and complexity before code, compare only after the timer.
0:00-0:04 — Warm up. Answer the MCQs below fast. No notes, no lesson tabs.
0:04-0:05 — Set the room. Open a blank file and the first LeetCode prompt. Start solving by minute 5.
0:05-0:35 — DSA Problem 1. First say the pattern, brute force, better approach, and time/space. If stuck after 25 minutes, reread only the pattern name.
0:35-1:05 — DSA Problem 2. Same rules: explain aloud first, then code. Keep the timer honest.
1:05-1:10 — DSA compare note. Write one line per miss: wrong invariant, missed edge case, implementation bug, or unclear complexity.
1:10-1:55 — Notification system design. Use exactly this timing: requirements 5, scale 5, API 5, data model 5, boxes 10, bottleneck 10, failures 5.
1:55-2:00 — Gate. Score the session using the self-check below. Failed items go to the next revision queue.
Design a notification system from scratch: email, SMS, and push delivery for users.
Seven-step script: requirements → scale → API → data model → boxes → bottleneck → failures
45 min
For the design block, do not hunt for a lesson. The test is whether the script can create the first reasonable design.
Warm-up MCQs
1. Which invariant identifies inorder traversal?
Lesson 28 invariant: "Inorder means: fully visit the left subtree, then this node, then the right subtree — recursion does the bookkeeping for you."
2. What should height-piggyback DFS return?
Lesson 32 invariant: "Compute height recursively and carry the real answer up alongside it — one traversal answers both questions."
3. Which move keeps BFS levels separate?
Lesson 31 invariant: "A queue processes nodes in the order discovered; snapshot the queue length to process exactly one level at a time."
4. Which signal makes the current node LCA?
Lesson 33 invariant: "If the two targets are found in different subtrees of a node, you are standing on the answer."
5. Which invariant preserves serialized tree shape?
Lesson 34 invariant: "Preorder with explicit null markers is unambiguous — the string rebuilds exactly one tree."
6. During a data partition, what choice appears?
Lesson 57 invariant: "You scale up with a bigger box or out with more boxes; once data lives on more than one box, a network partition forces the CAP choice between consistency and availability."
Self-check gate
Pass tonight if both DSA problems had a spoken invariant and complexity before code, the BFS answer used a queue-length snapshot, the LCA answer combined left and right returns correctly, and the notification design has all seven headings filled.
Failure path: add the failed DSA problem to the next tree revision and run it from a blank file using the revision protocol. If the design missed boxes, bottleneck, or failures, add "notification system" to the next design review and redo the seven headings before another mock.