Bring it all together / CHAPTER 63
The final design interview
Run a timed mock, test your weakest assumptions, and leave with a concrete revision plan.
Builds on A practical system design template, Design Ticketmaster-style seat booking.
- Deliver a coherent 45-minute system design discussion.
- Score the evidence in your answer against an explicit rubric.
- Use failure tests and quiz results to choose focused revision.
01Pick a prompt and reset the page
The final rehearsal checks whether another person can follow your design from a blank page. Choose a studied case, close its answer, then record yourself or ask a partner to interview you. Change one important constraint so you must reason again: add private data, a second region, ten times the peak, or a payment response lost after the customer may have been charged.
Use this prompt when practising alone:
Design concert booking. Customers browse seats, hold their complete selected seat group for two minutes, pay, and recover booking status after a timeout.
Clarify the promises before drawing:
- Must a two-seat request receive both seats or neither? Assume yes: no partial group.
- When does the customer become the confirmed owner, and what happens while payment is uncertain?
- Which payment methods can query or safely repeat an earlier operation?
The central correctness rule is at most one confirmed booking owner for each event-seat.
Prepare the same seven areas used in the course:
- Requirements: functions, measurable service targets, exclusions and rules that must always hold.
- Estimates: traffic and bytes, assumptions and units, plus what each important result changes.
- API: requests, responses, errors and recovery after timeout.
- Data model: stored records and keys, who changes them, and which changes must commit together.
- High-level design: complete read/write paths, including the records saved before success.
- Deep dive: the hard mechanism or bottleneck, alternatives, one justified change and its cost.
- Failure review: races, timeouts, permissions, accepted tradeoffs and the next test.
Write assumptions where your partner can challenge them. A component name is not evidence that an operation works; a calculation or trace must explain it.
02Spend 45 minutes deliberately
Use this 45-minute sequence, adapting when the interviewer deliberately explores one hard operation:
| Time | Step | What should appear on the page? |
|---|---|---|
| 0–5 min | 1. Clarify requirements | Numbered functions and service targets, exclusions and the no-double-owner rule. |
| 5–8 min | 2. Estimate | Important request/byte calculations and a design consequence. |
| 8–11 min | 3. Define the API | Example requests, success, errors and keys for matching retries. |
| 11–14 min | 4. Define records | Seat, hold, booking and request-result keys; required transactions. |
| 14–22 min | 5. Draw the first working design | A full browse path and group-hold write path. |
| 22–40 min | 6. Deep-dive and evolve | Show the actual concurrency or scale mechanism, its alternative and cost. |
| 40–45 min | 7. Review failures | Lose a response, race two buyers and resolve a payment timeout. |
Build a compact concert baseline
- Browse:
GET /events/E1/seatsreturns a timestamped cached seat map for eventE1. It can show an older available seat; it cannot grant that seat. - Request a group:
POST /events/E1/holdscarries seats[A7,A8]and one request key. The reservation service checks and claims the whole group in one transaction, then returns holdH1and its deadline. - Save the records: a
Seatrow is keyed by event and seat; aHoldrow linksH1to the account and complete group. A request-result row maps the account/key to the submitted fields and originalH1result. - Recover the hold: repeating its key with matching fields returns
H1and the original deadline; it does not restart the two minutes. - Begin checkout: the client sends a separate request key that it will keep for retries. In one transaction, verify that
H1belongs to this account, still holds the complete seat group and has not expired at the time of the check. Save bookingB1, that checkout key and a pending provider-operation ID; change the seats to payment-pending before contacting the provider. - Recover checkout: if its response is lost, repeat the checkout key to retrieve
B1, then callGET /bookings/B1. This recovers an ID from saved state rather than requiring one that appeared only in the missing response.
At 100,000 browse requests/s and 50 KB per map, payload is 5 GB/s. Caching can reduce repeated origin work, though those bytes still reach viewers. If tests show the writer safely handles 2,000 holds/s, limit excess launch attempts; that test does not prove seat correctness.
Trace the baseline first. Add a waiting room to control excess work and explicit payment states to resolve uncertain charges only where those requirements justify them.
03Score visible reasoning, not component count
After the mock, score what another person can actually find in the recording or page. These are practice weights, not an employer's policy.
| Area | Points | What earns evidence? |
|---|---|---|
| Requirements and scope | 15 | Identify users, functions, exclusions, targets and the ownership rule. |
| Estimates | 10 | Calculate with units and show how a result changes the design. |
| API and records | 15 | Show requests, outcomes, keys, stored results and retry behavior. |
| Working baseline | 20 | Trace a request to saved state and an honest success response. |
| Scaling and tradeoffs | 15 | Identify a bottleneck and compare a justified change with its cost. |
| Reliability and security | 15 | Handle a race, uncertain result, access check and recovery. |
| Communication and close | 10 | Define terms in the operation, use clear traces, adapt and close. |
Suppose the score is 12+8+10+14+10+6+8 = 68. The drawing is readable, but a hold can acquire only half the requested group and a payment retry creates a fresh charge ID.
Use the score this way:
- Name the failed promises. Complete groups are not enforced, and response loss may create two charges.
- Repair those operations first. Show the all-or-nothing seat transaction and recovery of the original payment operation.
- Score the new explanation. Award credit for demonstrated behavior, not for adding a box or the word “idempotent.”
For partial credit, state the missing piece precisely: “The API accepts a retry key but saves no result for that key,” or “The storage calculation excludes replicas.” “Needs depth” does not tell the learner what to fix.
A high total cannot excuse two owners for one seat. Also distinguish a feature explicitly excluded during requirements from a required feature silently omitted to simplify the answer.
Turn a mock into a focused improvement loop
Follow the numbered arrows
- Prompt and requirements → 45-minute designwork through the seven design steps
- 45-minute design → Try a failuretest the rule the product must preserve
- Try a failure → Review the recordinginspect the actual returned and saved result
- Review the recording → Repair one missing stepchoose the most consequential gap
- Repair one missing step → Explain it againexplain why the repair prevents the error
Trace the diagram in words
- Explain the agreed functions and trace the main request to its saved result.
- Inject a concurrent request, a lost response and a permission change.
- Score what the explanation demonstrates, repair the largest gap and explain the corrected operation without the answer page.
04Inject failures and follow the state
Use two customers, Mina and Leo, to test the actual seat records. Both initially see A7 available; Mina requests A7 and A8 together.
- Mina's reservation transaction locks both seat rows before checking them. Each must be free, or held under an ordinary hold whose deadline has passed at the database’s check time. A seat in payment-pending or confirmed state is not free merely because two minutes elapsed.
- If both are available, save
H1and both claims with the request result. IfA8is unavailable, roll back the complete group; Mina receives neither seat. - Leo’s competing
A7request locks and checks the same saved row. After Mina commitsH1, the row points to her unexpired hold, so Leo is rejected. His earlier available-seat display cannot override that row. - Lose Mina's success response. A repeated request key finds
H1's saved result and returns its original deadline. A retry must not silently create a new two-minute hold. - Time out a payment that may have charged her. The client repeats its saved checkout key to recover booking
B1. The service queries the provider using the original payment operation ID retained with that booking. Absence of a response does not establish payment failure. - The checkout transaction changes the held seats to payment-pending. The ordinary hold-expiry cleanup must now leave them reserved while the recovery worker queries the saved provider operation. Confirm ownership only after payment success is known and the booking/seat records commit that outcome together; a definitive payment failure can release them. This can keep seats unavailable during a provider outage. If an exceptional recovery has already released them and a late charge succeeds, save refund-required state instead of granting a seat now promised to someone else.
Test other cases with equally concrete questions
| Case | Inject the failure | Show the record or check that prevents the wrong outcome |
|---|---|---|
| Feed | The audience changes after candidates were found. | Check the current post and viewer permission before showing it. |
| File sync | Two devices edit file version 7. | Reject a commit whose expected version is old and preserve the conflicting bytes. |
| Ride matching | One driver accepts two trips. | One coordinated assignment change must reject a conflicting driver/trip claim. |
| Rate limiter | Two servers spend the last token. | Check and deduct from the shared balance in one indivisible operation. |
| Video | A worker saves only some of the video versions listed in its encoding job. | Retry that job; publish playback metadata only after checking that every listed version and segment exists. |
For every failure, answer four questions
- Which record survives the crash?
- Which state change is allowed next?
- How does a retry identify and recover the original attempt?
- What does the caller see now?
A queue can save pending work. It does not by itself answer whether the business effect happened, which state is current or whether repeating that effect is safe.
05Make the next two hours count
Use the remaining practice time to repair the most consequential gap, then explain it without the answer page.
For the 68-point concert mock
- Write the seat transaction as three steps: protect the whole group, check every current seat, then save all claims and the result together or none.
- Write the payment-pending transition: checkout verifies the complete unexpired hold and saves the booking, checkout key and provider-operation ID together before contacting the provider.
- Write the payment outcomes: known payment success permits an atomic booking/seat confirmation; definitive failure permits seat release. A timeout remains pending while the saved provider operation is queried.
- Write the late-charge recovery: if paid inventory can no longer be granted, save refund-required state and arrange the refund; do not create a second owner.
- Replay Mina and Leo’s race and the lost response. Point to the record that makes the wrong outcome fail.
- Score only what is now demonstrated. A key without a saved key-to-result lookup still does not explain safe retry.
Choose other repairs in the same concrete way
- Recalculate a wrong estimate with units and identify the choice it changes.
- Replace “ensure consistency” with the actual conditional update or transaction.
- Replace an unclear diagram with one numbered request path and labeled results.
- After a missed quiz question, revisit its linked section and solve a changed example before trying the same question again.
Near the interview, use the revision deck for a 60-, 90- or 120-minute whole-course pass. Select all topics, attempt each answer before revealing it and mark “Again” when you recognize a term but cannot explain its operation. Recognition of a repeated option is weaker evidence than an independent explanation later.
Close the mock in four connected sentences
We support browsing, complete seat holds, checkout and booking recovery. A cached map serves browsing; a database transaction checks and reserves the complete group. The map may briefly show a taken seat as available, but only the reservation transaction grants it. Next I would test many buyers competing for the same seats and recovery after an uncertain payment.
That close names the agreed functions, working path, accepted tradeoff and next validation without claiming unmeasured production performance.
DRAW. CALCULATE. EXPLAIN.
Run, score and repair a complete mock
105 minutes · guided practice
Choose the concert prompt or an unfamiliar variation of another course case. Close its model answer before rehearsing.
- Record a 45-minute interview from a blank page.
- Spend 30 minutes assigning the 100 rubric points to specific calculations, traces and checks you actually demonstrated.
- Spend 30 minutes repairing the most consequential gap and explaining the corrected design again.
Prepare one page showing included and excluded functions, two API examples, records and keys, a complete request trace, a capacity calculation that changes a choice, and a table of failure states. Test a changed failure against the repair instead of memorizing the original answer.
Compare the worked solution
- Serve cached seat-map reads separately from reservation writes. The map is a display hint, not permission to own a seat.
- In one transaction, protect and check every requested event-seat row. Claim the whole group or roll back all claims. Save
H1and the original request's fields/result with that change. - On a repeated request, look up its key, check matching fields and return
H1's original deadline. Do not extend the hold because a response was lost. - Checkout locks the hold and seat rows, verifies the buyer, the complete group and an expiry later than the database’s check time, then saves the client-known checkout key, booking ID, payment-pending seat state and provider-operation ID in that same transaction. The provider call happens afterward. A repeated checkout key recovers that booking ID even if its creation response was lost. An unknown charge stays payment-pending: the hold-expiry cleanup cannot release those seats while the saved provider operation is being resolved.
- If a late successful charge cannot receive its inventory, save refund-required state and arrange that refund rather than create a second seat owner.
- The example score is 68. Repair group claims and payment recovery, then demonstrate Mina and Leo's race and a lost response against the saved records. For another case, substitute its actual operations and correctness rules rather than copying the concert architecture.
The checkboxes record your own assessment. The worked solution gives you a way to check the reasoning.
RETRIEVE BEFORE YOU REVEAL
Keep the important ideas.
Say the answer aloud, then turn the card over.
CARD 01What must a complete mock leave on the page?
- Show requirements, estimates, API and records.
- Trace complete requests and the hardest mechanism.
- Test failures and explain tradeoffs.
Name what is saved before success; component names alone do not demonstrate correctness.
CARD 02How do you turn a self-score into useful revision?
- Point to evidence for each score.
- Name the missing operation or check.
- Repair it and solve a changed example without the answer.
A high total cannot excuse a broken core promise.
CARD 03How do you close a design in two minutes?
- State the agreed functions and working request path.
- Explain the hardest tradeoff.
- Name the next measurement or failure test.
Do not claim a guarantee that has not been demonstrated.
CHECK THE REASONING
Can you explain the choice?
Answer every question, then finish for an immediate score and an explanation for each answer. Aim for 80%, then revisit any gaps.
CLOSE THE LOOP
Explain it without the page.
Summarise the mechanism, one trade-off, and one failure mode. Then mark this chapter complete.