</> 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 design survived its deep dives; now the interviewer tries to break it. Seven challenges follow, each pushing on an earlier decision. Every answer follows one pattern: name what is being tested, put a ledger number on it, give the mechanism and the rejected alternative, and finish with the senior line. The numbers remain this interview's assumptions: orders peaks at 50,000 msg/s across 64 partitions on 30 brokers in three zones.

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

You: "Please do. I'll name the decision each one stresses and what would flip it."

Flowchart of the seven interviewer challenges and the decision each one stresses: global order across all orders (one partition's ceiling), one merchant being 40% of orders (per-partition hot spot) and ten times the partitions (cost of each partition) all push on keys and partitions, Decision 2; analytics being 3 days behind pushes on page cache and retention, Decisions 4 and 5, through tail in RAM vs disk reads; exactly-once into Postgres pushes on delivery semantics, Decision 8, through where transactions stop; delayed and priority messages push on pull and offsets, Decision 1, because a log is not a queue; and active-active in two regions pushes on zones and mirroring, Decision 11, through acks=all vs the WAN.

Challenge 1: "I need a global order across all orders"

What they're testing: that order and parallelism both come from the partition.

Total order requires a single log. One partition puts the 50 MB/s peak on one leader, at the tens-of-MB/s ceiling a partition can sustain, and cuts every group to one active member: fulfillment's 16 consumers become 1, fraud's 32 too. So I ask what invariant they need. "Placed comes before shipped for order-58213" is a per-key guarantee, and Decision 2 already provides it. If a job truly needs one timeline, I'd sequence at the consumer, merging the 64 partitions by event timestamp behind a watermark for a bounded delay. A sequencer stamping every event before produce just moves the bottleneck.

The senior line: "Global order is usually per-entity order in disguise. I'll pay for a total order only on the stream that needs one, ceiling stated."

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.