The System Design Interview Framework
The system design interview framework is the fixed order of steps used to design a system in an interview. The steps are clarify, estimate, API, records, scale, and trade-offs.
The recognition signal
An interviewer asks for a system design when the prompt names a whole product, not one function. The framework below is the reply shape.
steps = ["Clarify", "Estimate", "API", "Data model", "Scale", "Trade-offs"]
for i, step in enumerate(steps, 1):
print(str(i) + ". " + step)The framework template
Each step carries one question. Answering the six questions in order keeps the design moving.
plan = [
("Clarify", "Who uses it and what must it do?"),
("Estimate", "How many users and requests?"),
("API", "Which operations does it offer?"),
("Data model", "Which fields does each record hold?"),
("Scale", "Which parts grow first?"),
("Trade-offs", "What is given up for what?"),
]
for step, question in plan:
print(step + ": " + question)Worked problem: clarify a short-link service
The clarify step asks who uses the service, how long links last, and how many links arrive each day. No component is picked yet.
questions = [
"Who creates the short links?",
"How long must a link stay valid?",
"How many links are created each day?",
]
for q in questions:
print("Clarify: " + q)Example
plan = [
("Clarify", "Readers view photos from people they follow."),
("Estimate", "Ten million daily readers."),
("API", "Post a photo and fetch a feed."),
("Data model", "A photo holds an owner, an image, and a caption."),
("Scale", "Reads grow faster than writes."),
("Trade-offs", "A slightly stale feed keeps reads fast."),
]
for step, note in plan:
print(step + ": " + note)Key points
- Prerequisite: the System Design Beginner, Intermediate, and Advanced courses teach the components this framework arranges.
- Clarify the requirements and the scope before sketching anything.
- Estimate the scale with plain arithmetic before choosing components.
- Define the API operations and the stored records before sketching scale.
- Close with trade-offs and limits instead of claiming a perfect design.
- The framework is a fixed order of steps, not a new system to learn.
The plan follows the framework in order. Clarify fixes the readers and the job. Estimate sizes the audience. API and records fix the operations and the stored data. Scale and trade-offs close the design.
Try it Yourself
Edit the code, then press Run.
Running is simulated · Python Playground
Exercise
What is the first step of the system design interview framework?