LearnastraTHE DESIGN COURSE

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.

Advanced3h of deliberate study10 questions

Builds on A practical system design template, Design Ticketmaster-style seat booking.

By the end, you can
  • 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:

  1. Must a two-seat request receive both seats or neither? Assume yes: no partial group.
  2. When does the customer become the confirmed owner, and what happens while payment is uncertain?
  3. 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:

  1. Requirements: functions, measurable service targets, exclusions and rules that must always hold.
  2. Estimates: traffic and bytes, assumptions and units, plus what each important result changes.
  3. API: requests, responses, errors and recovery after timeout.
  4. Data model: stored records and keys, who changes them, and which changes must commit together.
  5. High-level design: complete read/write paths, including the records saved before success.
  6. Deep dive: the hard mechanism or bottleneck, alternatives, one justified change and its cost.
  7. 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

  1. Browse: GET /events/E1/seats returns a timestamped cached seat map for event E1. It can show an older available seat; it cannot grant that seat.
  2. Request a group: POST /events/E1/holds carries seats [A7,A8] and one request key. The reservation service checks and claims the whole group in one transaction, then returns hold H1 and its deadline.
  3. Save the records: a Seat row is keyed by event and seat; a Hold row links H1 to the account and complete group. A request-result row maps the account/key to the submitted fields and original H1 result.
  4. Recover the hold: repeating its key with matching fields returns H1 and the original deadline; it does not restart the two minutes.
  5. Begin checkout: the client sends a separate request key that it will keep for retries. In one transaction, verify that H1 belongs to this account, still holds the complete seat group and has not expired at the time of the check. Save booking B1, that checkout key and a pending provider-operation ID; change the seats to payment-pending before contacting the provider.
  6. Recover checkout: if its response is lost, repeat the checkout key to retrieve B1, then call GET /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:

  1. Name the failed promises. Complete groups are not enforced, and response loss may create two charges.
  2. Repair those operations first. Show the all-or-nothing seat transaction and recovery of the original payment operation.
  3. 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

Turn a mock into a focused improvement loopExplain 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. Numbered arrows correspond to the connection key below. All connections are directional.Prompt andrequirementsAsk which functionsand rules matter45-minute designTrace complete readsand writesTry a failureRace two requests;lose a responseExplain it againClose the modelanswer beforespeakingRepair onemissing stepShow the record,check or calculationReview therecordingAward points fordemonstrated behavior12345Turn a mock into a focused improvement loopExplain 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. Numbered arrows correspond to the connection key below. All connections are directional.Prompt andrequirementsAsk which functionsand rules matter45-minute designTrace complete readsand writesTry a failureRace two requests;lose a responseExplain it againClose the modelanswer beforespeakingRepair onemissing stepShow the record,check or calculationReview therecordingAward points fordemonstrated behavior12345Turn a mock into a focused improvement loopExplain 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. Numbered arrows correspond to the connection key below. All connections are directional.Prompt andrequirementsAsk which functionsand rules matter45-minute designTrace complete readsand writesTry a failureRace two requests;lose a responseExplain it againClose the modelanswer beforespeakingRepair onemissing stepShow the record,check or calculationReview therecordingAward points fordemonstrated behavior12345

Follow the numbered arrows

  1. Prompt and requirements → 45-minute designwork through the seven design steps
  2. 45-minute design → Try a failuretest the rule the product must preserve
  3. Try a failure → Review the recordinginspect the actual returned and saved result
  4. Review the recording → Repair one missing stepchoose the most consequential gap
  5. Repair one missing step → Explain it againexplain why the repair prevents the error
Score what the explanation actually demonstrates, repair its most consequential gap, then explain the corrected mechanism without reading the answer.
Trace the diagram in words
  1. Explain the agreed functions and trace the main request to its saved result.
  2. Inject a concurrent request, a lost response and a permission change.
  3. 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.

  1. 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.
  2. If both are available, save H1 and both claims with the request result. If A8 is unavailable, roll back the complete group; Mina receives neither seat.
  3. Leo’s competing A7 request locks and checks the same saved row. After Mina commits H1, the row points to her unexpired hold, so Leo is rejected. His earlier available-seat display cannot override that row.
  4. 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.
  5. 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.
  6. 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

  1. Which record survives the crash?
  2. Which state change is allowed next?
  3. How does a retry identify and recover the original attempt?
  4. 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Replay Mina and Leo’s race and the lost response. Point to the record that makes the wrong outcome fail.
  6. 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.

  1. Record a 45-minute interview from a blank page.
  2. Spend 30 minutes assigning the 100 rubric points to specific calculations, traces and checks you actually demonstrated.
  3. 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.

Your self-check
Compare the worked solution
  1. Serve cached seat-map reads separately from reservation writes. The map is a display hint, not permission to own a seat.
  2. In one transaction, protect and check every requested event-seat row. Claim the whole group or roll back all claims. Save H1 and the original request's fields/result with that change.
  3. 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.
  4. 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.
  5. If a late successful charge cannot receive its inventory, save refund-required state and arrange that refund rather than create a second seat owner.
  6. 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?
  1. Show requirements, estimates, API and records.
  2. Trace complete requests and the hardest mechanism.
  3. 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?
  1. Point to evidence for each score.
  2. Name the missing operation or check.
  3. 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?
  1. State the agreed functions and working request path.
  2. Explain the hardest tradeoff.
  3. Name the next measurement or failure test.

Do not claim a guarantee that has not been demonstrated.

Practise this topic in the revision deck ↗

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.

1 / 10The agreed requirement is an all-or-nothing two-seat hold. Which transaction implements it?
2 / 10A 50 KB map is delivered 100,000 times/second. What payload rate follows?
3 / 10Why specify GET /bookings/B1 during checkout design?
4 / 10The mock shows a request key, but no retained result; a retry after response loss creates a fresh hold. How should that evidence be scored and repaired?
5 / 10A candidate scores 85 but allows two confirmed owners for A7. What is the priority?
6 / 10You have agreed the hold requirements. Which pair correctly separates API design from data-model design?
7 / 10The hold committed but its response disappeared. What must the retry recover?
8 / 10Why is a queue box insufficient evidence for handling a worker crash?
9 / 10Which change demonstrates repair of vague idempotency reasoning?
10 / 10Which close best states the remaining validation?
0 of 10 answered

CLOSE THE LOOP

Explain it without the page.

Summarise the mechanism, one trade-off, and one failure mode. Then mark this chapter complete.