Driving deep dives
easy 30 minFifteen minutes, two hard parts.
Video lesson · Chapter 1 of 5
Find an actual risk
Offer two, finish one
1:20Reel coming soon
Theory
Read or listen first. About 1 min.
What it is
A deep dive is the part of the interview where you look closely at one hard problem: options, a decision, numbers, and what happens when it fails.
You usually have time for two.
Why it exists
The overview shows that you know the parts. Depth shows that you have thought about how they behave.
It is also where levels differ most, so it deserves the largest share of time.
A short history
1949
The US military describes failure mode and effects analysis: list how each part can fail and what follows.
1950s to 1970s
Toyota's engineers use repeated "why" questions to find root causes.
2004
Jesse Robbins starts game days at Amazon, breaking things on purpose to learn.
2011
Netflix writes about Chaos Monkey, which stops servers at random.
Words to know
- Crux
- The part that decides whether the design works.
- Failure drill
- Walking through a failure and its recovery.
- Hot spot
- One place with far more load than the rest.
- Blast radius
- How much is affected when something fails.
- Hint
- An interviewer's nudge towards something.
How it works
Step through the idea, or press Play.
Find. The part that misses a target or makes this problem different
Understand it
Start here
A diver with limited air
A diver cannot look under every stone. There is air for two good stops and a safe way up. Your interview has air for two deep dives and a summary.
Find it
Where is the hard part?
- 1
Read the targets again
Which one does the design on the board still miss? That is the first dive.
- 2
Subtract the ordinary
Take away create, read, update and delete. What is left is the special part: a rush, live data, search, privacy, money.
- 3
Look for many on one
Many writers on one row, many readers of one key, many reconnects at one moment.
- 4
Ask what is worst if wrong
Lost money or a child's location beats a slow page.
| System | Misses a target | Makes it different | Offer these two |
|---|---|---|---|
| Library seat booking | 5,000 readers want 80 seats at 9:00 | Holds that are never confirmed | The rush, abandoned holds |
| School bus tracker | 20,000 parents at 7:45 | Only the right family may see a stop | Live updates, who may watch |
| Recipe sharing | Search by what is in the kitchen | Photos of every size | Ingredient search, photo pipeline |
| URL shortener | Reads for one viral link | Unique codes from many servers | Code generation, hot links |
| Ride hailing | 333,000 positions a second | One driver, two riders | Live positions, matching |
Offer it
Two doors, one recommendation
Offering two shows you can see what matters. Recommending one shows you can lead. Asking shows you can listen. It takes one breath.
Minute 25
You
The whole path works. Two parts deserve depth. One is the rush at 9:00, where thousands want the same 80 seats. The other is a seat that someone holds and never confirms. I would start with the rush, because it decides whether the system survives. Is that where you would like to go?
Interviewer
Start with the rush, yes.
You
I will take about seven minutes, then come back for holds.
A good offer
- Two parts, one sentence each
- A reason for the first
- A question at the end
- A time
A weak offer
- "What do you want to talk about?"
- "I could go deeper anywhere."
- Starting the easy part you rehearsed
- Five choices
Walk it
From options to a decision
One dive, five moves
Seven minutes, twice
Worked example: the 9:00 rush. 5,000 readers want 80 seats in one building. Whatever we build, at least 4,920 of them must be told no.
Most attempts must fail
| Option | Grade | What happens |
|---|---|---|
| Lock the whole building | breaks | One booking at a time. At 50 ms each, 80 seats take 4 s and everyone else waits or times out |
| Let all 5,000 try, unique rule decides | works | Correct. But 98.4% of the load is wasted, and it lands in one second |
| Waiting room, then the unique rule | strong | Same correctness, steady load, a place in the queue for each reader |
Walk one request
Break it
Failure drills with numbers
A failure drill asks four things. What stops? Where does the load go? Who notices? How does it recover? The second one needs a number.
Seat booking: switch off one part at a time
| Off | The load goes | Users see | Recovery |
|---|---|---|---|
| Seat map cache | 5,000 map reads/s fall on the database | Slow pages, then failed bookings | Each server asks once per building and shares the answer; serve the last map; refuse extra reads |
| Waiting room | 5,000 attempts/s reach the service | Errors at 9:00 | Admit a fixed number, turn the rest away with a time to retry |
| Primary database, 30 s | 300 × 30 = 9,000 attempts fail | "Try again" for half a minute | Standby takes over; clients retry with a growing, random wait and the same idempotency key |
| Email queue | Emails wait in a table | A late email, a valid booking | Send from the table when the queue returns |
Why retries need care
The drill
Bus tracker: the servers restart at 7:45
Interviewer
You moved to open connections. All the connection servers restart. What happens?
You
20,000 parents reconnect at once. If they all try in the same second, that is 20,000 sign-in checks in a second. I would have each app wait a random time up to 60 seconds, which is about 333 a second.
Interviewer
Sixty seconds without a bus, on a school morning?
You
Fair. Until it reconnects the app asks over plain HTTP every ten seconds, so the position stays within ten seconds. We also restart servers one at a time, so this is the rare case.
Spreading the return
Listen
Reading hints
What they say, what it may mean
"Are you sure?"
Check the last thing you said. There may be a fault, or they want the reason.
"What if there are two?"
Think races: two servers, two requests, the same record.
"And at ten times that?"
Find the first part that breaks, with a number.
"Let us come back to this"
Enough here. Stop and move on.
The same question twice
Your answer missed. Say what you think they are after and check.
"Interesting" and silence
Finish the thought, then ask if they want more.
Lead or follow
Leading and being led
| They are | You do | You say |
|---|---|---|
| Quiet | Lead: offer, recommend, go | "I will start with the rush unless you prefer holds." |
| Steering | Follow: go there now | "Happy to. I will keep holds for later." |
| Jumping around | Answer short, then anchor | "Yes, because... Back to the waiting room?" |
| Going very deep | Say what you know and where it ends | "I know the idea, not the code. I would expect..." |
Following is not a failure. It becomes one only when you go quiet between questions and wait to be pulled. After each answer, add the next step yourself.
Stuck
Getting unstuck
Four ways out
Unstuck, word for word
Interviewer
Two of your servers hand out the same seat. How?
You
Let me take the smallest case: two readers, one seat. Both servers read that it is free. Both write. The second write must lose, so checking first is not enough. The decision has to happen in the write itself.
Interviewer
So?
You
So the unique rule on seat and slot decides. The loser gets an error, and we show them another seat. No lock between the servers is needed.
Second example
URL shortener: one hot link
- 1
State it
One link gets 50,000 clicks a second. One key lives on one Redis node.
- 2
Options
Read the database each time: breaks, one partition. Redis only: works until one key overloads one node. A one-second copy inside each server: strong.
- 3
Choose
Keep the hottest links in each server for a second. With 20 servers, Redis sees at most about 20 reads a second for that link.
- 4
Cost
An edit or a takedown may lag a second on top of the edge time. Takedowns also send a purge.
- 5
Break it
All 20 servers restart empty. The first requests in each share one lookup, so Redis sees about 20 reads, not 50,000.
Summary
The whole topic in one minute.
Find the two parts that matter, offer them, go from options to a decision, then break your own choice with load numbers.
Follow hints. They show where the interviewer wants evidence.
- Two dives, about seven minutes each, and stop at 40.
- Offer two, recommend one, ask.
- Options, choice, one request, one failure.
- A failure drill asks where the load goes, with a number.
- A hint is a gift: say it back and follow it.