Section 9: Six Ways to Break It - Interviewer Deep-Dive Challenges
Executive Summary: With the architecture settled, the interviewer stops building and starts attacking. We take six escalations in order, answering each with one discipline: size the threat with a number before reaching for machinery, name the mechanism, name the alternative that would have failed, and say what was being probed.
For fifty minutes the interviewer has been a collaborator; now they are the on-call engineer who has to carry this thing. Candidates misread the shift and start bolting on — a cache here, a queue to be safe. Resist that. Each of these six has an answer that begins with arithmetic, and in four of them the arithmetic shows the design already holds.
Challenge One: Forty Thousand People in One Cell
"It's 1pm, the Giants game just let out, and forty thousand people are standing inside a single geohash cell a few kilometres north of Maya. Walk me through what melts."
Number first. Forty thousand users on a thirty-second cadence is about 1,300 updates per second — against a peak ingest of roughly 333 thousand, that crowd is under half a percent of normal load. The stadium is not a traffic event. It is a distribution event, and only if you let geography into your partition key.
The mechanism is Section 5's choice: partition the location cache and session routing by user ID. Those forty thousand writes scatter uniformly across every partition and session server, because the shard a user lands on has nothing to do with where their body is. The hot cell never exists as a shard, so there is nothing to melt. The rejected alternative is the intuitive one — partition by geohash cell — which puts all forty thousand on one shard and, because users move, turns every boundary crossing into a migration. A user ID is stable for life; a location is stable for thirty seconds. Flip trigger: Section 12's nearby-strangers feature does need geographic locality, and earns a separate geo-partitioned index rather than a repartitioning of this one.
What does spike is fan-out density. Normally one in ten of your online friends is inside the band — four channels per update, not forty. In a stadium that inverts: a fan with 420 friends and 38 online may have five to eight of them in the same cell. Three pre-existing levers absorb it — Section 7's per-update fan-out cap, Section 4's server-driven cadence back-off (returning the stationary tier's 300-second interval divides the spike by ten), and shedding completeness to the bootstrap read. What it probes: whether you know what your own partition key bought you.
Quick check before moving on:
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