Requirements and Scope
How to turn a one-line design prompt into functional and non-functional requirements, which questions to ask, and what interviewers look for in this step.
On this page
- Where this step fits
- Functional requirements and the core use cases
- Scope: what you will not design
- Scale: how many users and what mix of reads and writes
- Non-functional requirements
- Writing the requirements down and ranking them
- Different paths can have different requirements
- Handling vague answers, too many questions and changed requirements
- In the interview
- What to practise next
Requirements and scope is the first step of a system design interview. You ask questions to find out what the system must do, how well it must do it, and what you are allowed to leave out, and then you write the answers down. It solves the problem that a prompt such as "design a restaurant reservation system" is too vague to design from, and that two different answers to the same prompt can lead to completely different architectures.
Without this step, candidates design for requirements they invented. A candidate who builds a fast, cached table search may find out thirty minutes later that the interviewer cares most about never booking the same table twice, and by then there is no time left to change the write path. One question at the start, such as "is it ever acceptable to double-book a table?", would have avoided it.
Where this step fits
This is the first part of the framework in A Framework for Any Design, and it should take about five minutes of a 45-minute interview. The interviewer is not only collecting information. They are checking that you ask questions before you draw anything, that your questions are about things that change the design, and that you can turn the answers into decisions. The steps below are in the order you do them. The first three are expected every time, and the last two are worth doing only when the problem calls for them.
Functional requirements and the core use cases
Functional requirements are the things the system does, written as what a user can do: a diner searches for open tables by restaurant, date and party size, books a table, and cancels a booking. List the two to four actions that make up the product, and say them out loud. You are not trying to list every feature. Each extra feature adds design work, so a short list that the interviewer confirms is better than a long one that you cannot finish.
Also ask who the users are, because a system with two kinds of user, such as diners and restaurant owners, has two sets of actions. You can decide that one kind is out of scope, as long as you say so.
Scope: what you will not design
After the core actions, name what you will leave out. For example: "I'll skip payments, reviews and waitlists. Does that match what you want?" Propose the cut yourself instead of asking "what should I leave out?", because it shows judgment and the interviewer only has to agree or correct you. If the interviewer pulls something back in, you have lost nothing, and if they agree, you have bought time for the parts that matter.
Scale: how many users and what mix of reads and writes
Ask how many users or requests there are per day, and how reads compare with writes. You ask because the answers decide whether you need caching, read replicas, or partitioning at all. A system with 1,000 requests a day fits on one database, and a design full of queues and shards for it counts against you. The read to write ratio matters most: if reads outnumber writes 20 to 1, the read path is the one to optimise, and if writes dominate, you design around ingestion. Also ask whether traffic is steady or arrives in peaks, such as a rush before dinner time, because the system has to handle the peak and not the average. Do not do detailed arithmetic here. Collect the numbers, and turn them into rates and sizes in the estimation step, which is covered in Back-of-the-Envelope Estimation.
Non-functional requirements
Non-functional requirements say how well the system must work. Four of them come up in almost every interview, and each has a question that changes the design.
Latency
Ask how fast the main operations must respond. A search that must return in under 200 ms points towards caches and replicas, while an operation that can take a few seconds, such as sending a receipt, can be done in the background through a queue.
Availability
Ask how much downtime is acceptable and whether it is the same everywhere. Availability is stated as a percentage, so convert it into time: 99.9% allows about 43 minutes of downtime a month, and 99.99% allows about 4 minutes. At 4 minutes no person can react in time, so failover has to be automatic, which is a bigger design than a service that may be down for 43 minutes.
Consistency
Ask what must never be wrong and what may be slightly out of date. Double bookings, lost messages and charging a customer twice are things that cannot happen, and they need a single source of truth with transactions or conditional writes. A search result that is a few seconds old usually does not matter, which allows replicas and caches. This is the question that most often separates a strong answer from a weak one. The background is in CAP and Consistency.
Durability
Ask whether data may be lost. A confirmed booking must survive a server crash, so the database must acknowledge the write only after it is stored safely, perhaps on more than one machine. A "last seen" timestamp can be lost without harm and can be written much more cheaply.
Optional: security, privacy, cost and regions
Ask about these only when the problem points to them. Payments and personal data make security and privacy part of the design, a global product needs a regions question, and a prototype with a small budget changes which options are sensible. If the prompt gives no hint, mention that you assume standard authentication and move on.
Writing the requirements down and ranking them
Write the result where the interviewer can see it, in three short groups: functional requirements, non-functional requirements with numbers, and out of scope. For the reservation system that is: search open tables, book and cancel; no double bookings, a confirmed booking is never lost, search under 200 ms and allowed to be a few seconds stale, booking 99.9% available; and payments, reviews and waitlists left out.
Then rank the requirements, so that you know which one wins when two conflict. Here a correct booking matters more than a fast booking, and fresh search results come last. The ranking is what lets you justify later choices, such as accepting a slower write to avoid double bookings.
Different paths can have different requirements
Do not set one consistency level, or one latency target, for the whole product. In the reservation system, search can be fast and slightly stale, booking must be strictly correct, and the confirmation email can arrive a minute late. Setting everything to strong consistency overloads the one database that has to stay fast, and setting everything to eventual consistency double-books tables. Each path gets the cheapest design that meets its own requirement.
request and replyasynchronous message
Handling vague answers, too many questions and changed requirements
Requirements without numbers
"Fast, scalable and highly available" describes every system, so it does not decide anything. Replace each word with a number and a condition, such as "search under 200 ms for 99% of requests" or "booking 99.9% available". If the interviewer does not give a number, propose one.
The interviewer says "you decide"
This is a test of judgment, not a way of avoiding the question. Pick a reasonable value, say it, and give a reason: "I'll assume 20 million searches a day and a few seconds of staleness is fine for search, unless you'd like something different." A stated assumption can be corrected, and a silent one cannot.
Asking too many questions
Ten minutes of questions leaves no time for the design, and it looks like stalling. Ask the four to six questions whose answers would change what you build, then state the rest as assumptions. Skip a question if you would draw the same design whatever the answer.
The interviewer changes a requirement later
This is common, and it is usually deliberate: "now it needs to work globally." Go back to your ranked list, say which requirement changed and which parts of the design it touches, and adjust only those parts. Because you wrote the requirements down, this is a short conversation.
In the interview
Ask about features first, then scale, then the quality requirements, and give your reason when a requirement drives a decision: "Reads outnumber writes 20 to 1, so I'll optimise the read path." Finish by reading your list back and asking whether it matches.
Questions to expect:
- "Why did you ask about double bookings and not about the colour of the booking button?" Because the answer to the first question changes the architecture and the answer to the second does not. I only ask questions where a different answer would lead me to build something different.
- "What if I tell you to assume whatever you like?" I would state each assumption as a number or a rule, for example the number of requests per day and whether stale reads are acceptable, and then ask whether the interviewer wants to change any of them. This keeps the design moving and keeps every assumption visible.
- "Why not make search strongly consistent as well?" Every search would have to read the primary database, which is the machine that must stay fast for bookings. Stale search costs only an occasional failed booking attempt, which the booking check catches and reports as a conflict.
- "What does 99.99% availability mean for your design?" It allows about 4 minutes of downtime a month, which is too short for a person to respond. Failover to a standby must be automatic, and there must be no single machine whose failure takes the service down.
- "The primary dies just after confirming a booking. Is the booking lost?" With asynchronous replication it can be. If a confirmed booking must never be lost, the commit has to wait for at least one standby to have the data, which adds a few milliseconds to every booking. The ranking allows that cost.
- "What do you do when two requirements conflict?" I use the ranking I wrote at the start. In the reservation example, a correct booking beats a fast booking, so I accept the slower write.
- "How do you decide what is out of scope?" I leave out what is not part of the core actions and what would take a lot of design time for little signal, such as payments or reviews here. I say what I am leaving out and let the interviewer pull anything back in.
Design a restaurant reservation system.
Diners search for open tables, then book or cancel, and restaurants set up their tables. I'll leave out payments, reviews and waitlists. Does that match what you want?
Yes. We have about 20 million searches and 1 million bookings a day, in one country.
So searches outnumber bookings 20 to 1. Can search results be a few seconds stale, and is a double booking never acceptable?
Stale search is fine. No double bookings, ever.
Then booking will be strictly consistent on a single source of truth, and search will read from replicas and caches. Confirmation emails can be a minute late, so I'll send them through a queue.
Which of these is a non-functional requirement?
The interviewer wants booking to be 99.99% available instead of 99.9%. What does that change in the design?
A replica shows a table as free, but it was booked a moment ago. What should the booking request do?
What to practise next
Turn the scale answers into rates and sizes in Back-of-the-Envelope Estimation. For a case where the consistency of one path decides the whole design, see Design Ticket Booking.