</> MAANG.io

Expert

Design landmark systems in depth, from Dynamo, GFS, Bigtable and Kafka to payments and ads pipelines.

0 of 232 solved 0%

Section 11: The Escalation Gauntlet - Interviewer Deep-Dive Challenges

Executive Summary: The topology survived its deep dives; now the interviewer tries to break it. Seven challenges follow, each leaning on an earlier decision. Each answer names what's being tested, puts a ledger number on it, gives the mechanism and the rejected alternative, and ends with the senior line. The numbers are still this interview's assumptions: 600,000 posts/s at peak, 1.2 M hashtag tuples/s, about 100 executors on 12 machines.

Interviewer: "Good. Now I'm going to try to break it."

You: "Please do. I'll name the decision each one stresses."

Flowchart of the seven interviewer challenges and the mechanism each one stresses: billing per impression stresses acker and replay (Decision 3) and windowed state (Decisions 4, 9); a poison tuple stresses acker and replay; events 3 minutes late and a 24-hour window over 500 M tags stress windowed state; a celebrity hashtag at 40% stresses fields grouping (Decision 2), bounded in-flight work (Decision 5) and acker and replay; a 10x traffic spike stresses bounded in-flight work; and fifty teams on one cluster stresses scheduling and isolation (Decision 11).

Challenge 1: "Same pipeline, but it bills advertisers per impression"

What they're testing: whether you think acking gives you exactly-once. It doesn't.

Section 8's duplicate bound, a fraction of a percent of a window, is fine for a ±1% panel and an overcharge on an invoice. The acker doesn't remove duplicates; its replay creates them. Billing needs exactly-once state (Section 9): Trident stores each count with the txid of the batch that last wrote it and skips a replayed batch with the same txid, at the cost of batch latency and throughput. The sink must be idempotent too: upsert by impression id, or write count and txid atomically. And billing gets its own topology. Decision 3's flip applies to the money path, not to the panel.

The senior line: "Exactly-once lives in the state and the sink, not in the acker. I'd pay for it only where money moves."

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.