</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Section 9: Sunday Night Stress Test - Interviewer Deep-Dive Challenges

Executive Summary: With the write path and the scale-out story on the board, the interviewer starts trying to break the design. This section runs seven escalations: the season-end surge, "why not SQL?", the weekly primary dying on Sunday night, a run arriving after midnight, live spectators, a billion players, and a same-second tie. Each is answered by a decision you already made, with its number and its flip trigger.

Each escalation invites you to tear something down. Don't: size the threat, point to the decision that covers it, and say where it flips.

Challenge 1: The Season-End Surge

"It's the last hour of the week. Everyone is grinding for the top 10,000 and traffic doubles. What breaks?"

What they're really asking: Did you size for the worst hour, and do you know your margin?

The model answer: Section 3's design peak is this surge:

Evening peak                17,400 runs/s
Season-end surge (2×)       35,000 runs/s
Per board primary           35,000 × 2 ops = 70,000 ops/s   (budget 100,000 → 70%)
Replicas, if reads double   50,400 × 2 = 100,800 ops/s ≈ 50,400 per replica
Top-100 load on Redis       still 400 ZREVRANGE/s (set by the refresh, not by traffic)

Nothing breaks, but I'd say the margin out loud. A 3× surge would be 52,200 runs/s × 2 = 104,400 ops/s, over budget. So I'd test one dial before the season ends, keyed on the script's mine check, not on CH (which reads 0 for a new best a replay already applied). Improving runs keep the 2-op primary path. A non-improving run does its ZADD GT on the primary but takes its rank from a replica, only if the replica's ZSCORE for that player equals the best the script returned; otherwise the primary answers, so read-your-writes holds. All-time improves on 5% of runs and weekly on 20%, so at 3×:

All-time primary   52,200 + 52,200 × 0.05 = 54,810 ops/s
Weekly primary     52,200 + 52,200 × 0.20 = 62,640 ops/s   (both under 100,000)

The Best-Score Writer must hold its 1-minute lag SLO throughout, since Section 7's rebuild time depends on it. The grace window adds zero ops: each run still writes exactly one weekly board.

The senior line: "We sized for the surge. It's 70% of budget, and I know which dial comes before Section 8's sharding."

Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.