Skip to content
Laviyx Learn

Try

System Design course menu

How to Answer a System Design Interview Question

A step-by-step framework for system design interviews: clarify requirements, estimate scale, design the API and data model, draw the high-level design, go deep, and discuss trade-offs.

Beginner4 min readUpdated
On this page

"Design YouTube" sounds impossible in 45 minutes. It is meant to. The interviewer does not expect a finished system. They want to see how you think, how you handle unclear problems, and whether you can explain trade-offs.

A framework#

StepTime (45 min)Goal
1. Clarify requirements5 minAgree what you are building
2. Estimate scale5 minKnow how big it is
3. API and data model5 minDefine the interface
4. High-level design10 minDraw the main parts
5. Deep dive15 minSolve the hard parts
6. Wrap up5 minBottlenecks and trade-offs

Step 1: Clarify requirements#

Never start drawing straight away. Ask questions, and write the answers down.

Functional:

  • Who are the users?
  • What are the two or three core features?
  • What is out of scope?

Non-functional:

  • How many users, and how many requests?
  • Is it read-heavy or write-heavy?
  • What matters most: latency, consistency or availability?

Then state your scope: "I will focus on posting a link and redirecting. I will leave out accounts and analytics, unless you would like them."

Step 2: Estimate scale#

Rough numbers decide the design. You want the order of magnitude: is it 100 requests a second, or 100,000? The next lesson shows how.

Step 3: API and data model#

Name the main endpoints, and the key tables:

Text
POST /links   { url }           --> { code }
GET  /{code}                    --> 301 redirect

links(code PK, url, created_at, user_id)

This keeps you and the interviewer talking about the same system.

Step 4: High-level design#

Draw the path of a request. Start with something simple that works, then improve it:

Text
Client --> Load balancer --> App servers --> Cache --> Database

Talk through the main flows out loud: "When a user creates a link, the request goes to ..."

Step 5: Deep dive#

Choose the hardest parts, or ask the interviewer which interest them. Useful prompts to yourself:

  • How does it scale by 10 times?
  • What happens if each component fails?
  • Where is the bottleneck?
  • How is data kept consistent?

Step 6: Wrap up#

Summarise the design, name its weaknesses, and say what you would do with more time: monitoring, security, costs.

What interviewers look for#

Good signBad sign
Asks questions firstStarts drawing at once
Starts simple, then improvesJumps to complex technology
Explains whyLists buzzwords
Names trade-offsClaims one perfect answer
Drives the conversationWaits to be led
Changes the design when challengedDefends every choice

Useful phrases#

  • "Before I start, can I check a few requirements?"
  • "I will assume 10 million daily users. Does that sound right?"
  • "The trade-off here is ... so I would choose ... because ..."
  • "A simple version would be ... and if traffic grows, I would add ..."

Common mistakes#

Practice#

Practice exercise

You are asked to "design a parking lot app". Write five clarifying questions.

Show solution
  1. Is this for one lot or many?
  2. Do drivers book in advance, or only pay on exit?
  3. How many spots and vehicles a day?
  4. Do we need payments, or only tracking spaces?
  5. Are there vehicle types or special spots, such as for electric cars?

Any questions that narrow the scope are good. The aim is to show that you find out what is needed before designing.

Key takeaway#

Next: Back-of-the-Envelope Estimation.

Finished this lesson?

Some links are affiliate links. If you buy through them, Laviyx Learn may earn a commission at no extra cost to you. As an Amazon Associate, we earn from qualifying purchases.