Day 86 — Mock: DSA + System Design IV

mock day · 60-minute graph DSA mock · chat-system review

Tonight's goal: solve two graph problems under interview pressure, then explain the chat-system design aloud using fan-out, WebSockets, and queues.

Tonight's protocol

Use the mock-day protocol: speak first, code second, compare after the timer.

  1. 0:00-0:05: answer the warm-up MCQs below. If you miss one, read only its explanation, then start the mock.
  2. 0:05-0:35: solve Problem 1. Before typing, say the pattern, brute force, better approach, and time/space complexity aloud.
  3. 0:35-1:05: solve Problem 2 with the same rule. If stuck at minute 25 of either problem, read only the pattern name in the menu and use the last 5 minutes.
  4. 1:05-1:15: compare both attempts. Write one note per miss: invariant, bug, or edge case.
  5. 1:15-1:25: review chat design aloud: fan-out choice, WebSocket gateways, delivery queues, presence, receipts, and failure modes.
  6. 1:25-1:30: run the self-check gate and add any failed item to the next revision list.

The problem menu

TimeProblemPattern nameSay before coding
30 min Number of Islands grid DFS / flood fill Node, edge, traversal, visited mark, complexity.
30 min Course Schedule topological sort / cycle detection Node, edge direction, cycle test, complexity.

Warm-up MCQs

1. Which invariant matches Number of Islands?

2. A clone routine recurses before recording the clone. What breaks?

3. A prerequisite graph cannot peel every course. What does that mean?

4. Which move makes Pacific Atlantic efficient?

5. Which statement chooses the right shortest-path tool?

6. Which line belongs in the chat-system review?

Self-check gate

Pass tonight only if all three are true
  1. You stated node, edge, traversal choice, and complexity before coding both DSA problems.
  2. You completed the timed attempts without solution text during the 60-minute mock.
  3. You explained the chat design aloud with fan-out, WebSocket gateways, delivery queues, presence, receipts, and at least two failure modes.

If a DSA item fails, add that exact problem to the next graph revision list and tag the miss as pattern choice, complexity, implementation, or edge case. If the chat review fails, add "chat fan-out/WebSocket/queues redraw" to the next system-design revision.