Requirements First: Functional vs Non-Functional Requirements
What to clarify before designing anything: how functional and non-functional requirements differ, and how one number can change the entire architecture.
Every system design answer starts with requirements. A design question such as 'Design Instagram' is deliberately vague, and the architecture you draw only makes sense once you know which features matter, how many users there are, and what qualities the system must have.
System design has no perfect answer. Every design is a set of trade-offs, and you can only choose the right trade-off when the requirements are clear. These notes explain the two kinds of requirements, the questions that have the most influence on a design, and how to set the scope in the first five minutes.
Why requirements come first
A design question is deliberately vague. 'Design Instagram' could mean a photo upload service, a feed, stories, messaging, search or recommendations. The expected first step is to narrow it down before investing effort, exactly as you would with a real product manager.
Asking questions is not a sign of weakness. It shows that you know the answer depends on the problem. A diagram drawn without any questions solves an invented problem, which may or may not be the one that was asked.
Functional requirements: what the system does
Functional requirements describe behaviour. They are the features, written from the user's point of view. For a photo-sharing app, the core functional requirements might be the following.
- A user can upload a photo with a caption.
- A user can follow other users.
- A user can see a feed of photos from the accounts they follow.
Non-functional requirements: how well it does it
Non-functional requirements describe qualities. They do not add features; they constrain how the features must behave. The ones that matter most in interviews are listed below.
- Scalability: how many users and how much data must the system handle, and how fast is that growing?
- Availability: what fraction of the time must it be working? 99.9 percent allows about 8.7 hours of downtime a year; 99.99 percent allows about 52 minutes.
- Latency: how quickly must a request complete, usually stated as a percentile such as p99 under 200 ms.
- Consistency: must every user see the latest data immediately, or is a short delay acceptable?
- Durability: can any data ever be lost? For photos and payments the answer is no.
- Also consider security, cost and maintainability when they are relevant.
One sentence can change the whole design
'Show the feed' is a functional requirement. You could implement it with one database query. 'The feed must load in 200 milliseconds for 100 million users' is a non-functional requirement, and it changes everything: now you need a cache, read replicas, precomputed feeds and a CDN for images.
The functional requirement told you what to build. The non-functional requirement told you how hard it will be. This is why the architecture is determined mostly by non-functional requirements, and why you cannot design without them.
The question with the biggest impact: read-heavy or write-heavy?
Always ask about the ratio of reads to writes. A photo is uploaded once and viewed thousands of times, so a photo-sharing system is read-heavy, and caching and a CDN become the most important parts of the design. A logging system receives a constant stream of writes that are rarely read, so it is write-heavy, and the design centres on queues, batching and write-optimised storage. The same building blocks are available in both cases; the ratio tells you which ones to reach for.
Consistency or availability?
Ask which matters more when the two conflict. For a bank balance, showing a wrong value is unacceptable, so you favour consistency even if some requests fail during a network problem. For a like counter or a feed, showing a value that is a few seconds old is fine, so you favour availability and accept eventual consistency. This single answer decides your database choice and your replication strategy later in the interview.
Set the scope
An interview lasts about 45 minutes. You cannot design every feature, and trying to do so is a mistake. Propose a scope and get agreement: 'I will focus on upload, follow and feed. Shall we keep stories, reels and direct messages out of scope for now?' This shows that you can prioritise and manage time, and it lets you cover three features in depth instead of ten at the surface.
A worked example
Here is how the opening of 'Design Instagram' might sound after requirement gathering.
FUNCTIONAL 1. Upload a photo with a caption 2. Follow / unfollow a user 3. View a feed of photos from followed users Out of scope: stories, reels, DMs, search NON-FUNCTIONAL Scale : 100M daily active users, 10M uploads per day Latency : feed loads in < 200 ms (p99) Availability : 99.99% (favour availability over consistency) Consistency : eventual is acceptable for the feed Durability : an uploaded photo must never be lost Workload : read-heavy, roughly 100 reads per write IMPLICATIONS -> CDN + object storage for photos -> cache and precomputed feeds for the read path -> replication across zones for availability
The five opening questions
You can start almost any system design interview with these five questions.
- What are the core features we must support?
- How many users are there, and what latency do we need?
- Which matters more here: consistency or availability?
- Is the system read-heavy or write-heavy?
- What can we keep out of scope?
Common mistakes
- Starting the diagram before asking a single question.
- Asking twenty questions and never starting. Five minutes is enough; then state your assumptions and move on.
- Collecting requirements and then ignoring them. Refer back to them when you justify each decision: 'because we said the feed can be eventually consistent, I will…'.
- Listing 'scalable, reliable, fast' without numbers. A requirement without a number cannot guide a decision.
Summary
Functional requirements say what the system does; non-functional requirements say how well it must do it, and they are what actually shape the architecture. Before drawing anything, agree on features, scale, latency, consistency versus availability, the read-write ratio and the scope. Then use those answers as the reason behind every decision you make for the rest of the interview.
Puneet Tiwari
Full Stack Developer
