Think like a designer / CHAPTER 01
What a system design interview measures
Learn to turn an ambiguous product request into a defensible technical proposal.
- Identify the evidence a design discussion should produce.
- Explain a decision using requirements and consequences.
- Separate a useful first design from an exhaustive production specification.
01Start with a user outcome
Maya wants to upload an 8 MB photo on her phone and view it later on her laptop. Before drawing servers, decide what the service promises her:
- Who may read it? Assume only Maya may read the original and thumbnail.
- When may the phone show “uploaded”? Only after the required file and ownership record are safely saved.
- Must the thumbnail be ready immediately? Assume it may appear within one minute.
- Which failures must the original survive? Agree on a specific storage guarantee, such as loss of one storage machine.
These are requirements: statements of what the service must do. The architecture is the explanation of how its parts keep those promises.
An interviewer evaluates whether you can:
- Identify the users and operations before selecting components.
- Explain what one request reads, changes and returns.
- Find a load or failure that could break the proposal.
- Revise the affected operation when a requirement changes.
The first drawing can be small. It needs to explain this upload and read; it does not yet need every possible photo-sharing feature.
02Explain one decision all the way through
Let the phone send the large file directly to private file storage. Keep the photo’s owner and processing status in a database. These details about the file are metadata; they are separate from its image bytes. File storage is often called object storage: it saves bytes under a name. The database makes questions such as “which photos belong to Maya?” practical.
Follow the upload:
- The application verifies that the caller is Maya. This identity check is authentication.
- It creates one pending upload record. Call its identifier
u17; the phone will use it to refer to this same upload on later requests. - It gives Maya short-lived permission to write only the intended file, within the size limit.
- The phone transfers the file. The application then checks that the expected file finished uploading and belongs to this pending upload.
- The application changes the saved status from pending to processing. It returns “uploaded” only when the file and ownership record meet the agreed failure protection.
- A background worker finds saved processing records, creates the corresponding thumbnail and marks that photo ready after checking that the result belongs to this upload. If it crashes, another worker can find the still-processing record and retry the same thumbnail task; the task must not exist only in the first worker’s memory.
Saving data with the agreed failure protection is durability. A database commit completes the database changes under its configured guarantee. A file upload and a separate database commit are not automatically one operation; an unfinished upload needs visible pending status and eventual cleanup.
Now lose the confirmation response after step 5. The phone repeats confirmation for u17. The application must find that existing record and return its saved outcome rather than insert another photo. If the status is still pending, change it only through a database operation that checks and updates the status together. Simultaneous confirmations cannot both create new records. Keeping the intended result unchanged on repetition is idempotency.
03Choose depth and communicate uncertainty
For a read, checking identity is only the start:
- The application identifies the caller.
- It reads the photo’s saved ownership and status.
- It checks that this caller may read this photo. This permission check is authorization.
- Only then does it return the permitted original or thumbnail.
Explain a design choice by connecting its saved work and added work:
- Direct file upload saves the application from carrying every 8 MB file. It adds completion checks and abandoned-upload cleanup.
- Delayed thumbnail creation makes uploads finish sooner. It needs saved processing status so a worker can resume after a crash.
- Cached file copies can reduce repeated reads. They must still obey the required permission rules.
If the prompt changes to popular public photos, revisit bytes delivered per view, repeated access to one photo and delivery capacity. Privacy remains relevant wherever content is still private.
Close with evidence, not component names:
- Repeat confirmation after losing its response and verify that one photo exists.
- Request the photo from another account and verify that no private bytes are returned.
- Leave an upload unfinished and explain when its record and file are removed.
If you do not know a database feature, state the required behavior first: “Check pending status and save processing status together.” Verify the product’s way to do that instead of assuming separate reads and writes are safe.
A private upload exposes the real design questions
Follow the numbered arrows
- Maya’s phone → Private objectupload the permitted file within its size limit
- Private object → Confirm uploadcompletion is verified
- Confirm upload → Photo recordcommit one state transition
- Photo record → Thumbnail workerfind saved processing work
- Lost response → Confirm uploadrepeat confirmation for u17
Trace the diagram in words
- Follow u17 from bytes to a confirmed record.
- A lost response repeats confirmation of the same upload.
- The thumbnail can lag without changing who owns the original.
DRAW. CALCULATE. EXPLAIN.
Defend a private upload design
20 minutes · guided practice
A user uploads a private 12 MB document. Processing may take 30 seconds.
- State when “uploaded” and “ready” each become true.
- Draw the file and ownership-record steps.
- Lose the confirmation response after saving. Explain the repeated request.
- Explain an unauthorized read and an abandoned upload.
Compare the worked solution
- Verify the user’s identity and create one pending upload record. Give its identifier to the client so later confirmation refers to the same upload.
- Grant short-lived permission for the expected file and transfer its bytes. Verify completion before marking that record processing.
- Return “uploaded” only when the required bytes and ownership record meet the stated storage guarantee. Return “ready” after the worker verifies the processed output.
- If confirmation’s response is lost, look up that same upload. Return its completed result or finish the pending transition; do not create another document.
- Reject a read from another account before returning file bytes. After the confirmation deadline, a cleanup worker atomically changes a still-
pendingupload toabandoned. Confirmation may promote only apendingrecord, so cleanup cannot claim an upload already markedprocessing. After winning that claim, cleanup removes unreferenced files and the abandoned record.
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 01How do I justify a component?
- Start with a required operation.
- Explain who performs it and which data is saved.
- State what the component changes.
- Name the new failure case.
For direct upload, the phone sends bytes to object storage while the application saves ownership and verifies completion.
CARD 02Where should interview depth go?
- Show a complete upload and authorized read.
- Choose the risk with the largest consequence.
- Explain its mechanism and failure test.
Private photos require permission checks. Public viral photos also need enough capacity to deliver the same large file repeatedly.
CARD 03What happens after an uncertain response?
- The response may disappear after the application saves the change.
- The client repeats the original upload identifier.
- The application checks its saved state and returns that outcome.
Repeating confirmation must not create a new photo.
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.