System Design Requirements

Kanishka Naik
7 min readJun 16, 2024

--

Functional and Non-Functional requirements

In this Blog will see how to start approaching your system design interviews and discuss water functional and non-functional requirements and why it is important to know about them, let’s start with the definition

Functional Requirements:

These specify what the system should do, its capabilities, and the interactions between different components. They describe the system’s behavior in response to inputs under specific conditions. Functional requirements typically address the functional aspects of the system such as user interactions, data manipulation, and system processes.

Non-functional Requirements:

These define the quality attributes and constraints of the system, focusing on how the system performs rather than what it does. Non-functional requirements are concerned with attributes such as performance, reliability, security, scalability, and usability.

The system design interview starts with the problem statement like design Twitter or design Tiny URL, etc the first step is to try to figure out the functional and non-functional requirements.

Now before diving into it, let’s take an example of the construction of a hospital building what would be functional and non-functional requirements? the functional requirements would be to have the types of equipment, amount of OPDs, amount of entries and exits, and the way patients can get into the building, etc.

Hospital Building Example

and if it’s a hotel, the functional requirements would be to have a certain amount of rooms and a certain amount of luxury available in those rooms.

Hotel Building Example

this is the example of functional requirements which means a system or a building, how it is supposed to function, and the functionalities or features it is supposed to provide to fulfill the user requirements.

Now the non-functional Requirements, An example is how many stories that building would have or how many people can be accommodated in that building. In the case of an auditorium building, the non-functional requirement would be how many people can see and hear the clear sound in the auditorium, how and how many lightings could be placed, etc this is an example of non-functional requirements.

AuditoriumExample for Non-Functional Requirement

Now coming to our system design. Its very similar functional requirements define the system level or the component level needs of features that users are supposed to be provided. if we take the case of Twitter, the functional requirement would be user should be able to post, delete, update, favorite, tweet, or follow certain people,

Functional and Non-Functional Requirements of Twitter Example

and if we take non-functional requirements in the Twitter case, if a user posts a tweet it should take maybe less than a second or two seconds for that tweet to be published. In other words, we can say the latency of posting a tweet should be less than one second. Let’s say there are 100 million daily active users and all those hundred million daily active users will have a certain amount of transactions or requests going. On and your system should be able to handle that system should be available to handle those users. I hope you got a bit of an understanding of the difference between functional requirements and non-functional requirements.

Now let’s understand how to approach these requirements in an actual system design interview. As soon as your interview starts with questions with one-liners or two-liners like “ Design a ticket booking system” spend some time like 3 to 5 min minutes to understand these requirements. just try to dig deep inside the functional requirements. Try to understand what the system is trying to serve.

Now let’s take the example of a ticket booking system, and try to understand what a user should be able to do apart from booking a ticket, checking the history of the ticket, and canceling the ticket. Try to understand what other extended features the system is trying to fulfill. Once you get those non-functional requirements, try to make a note of those requirements on a white design board.

Ticket booking system Example

Once done, ask the interviewer for the non-functional requirements as well like Traffic, Availability, throughput, latency of the system, etc. The emphasis on non-functional requirements completely depends on the company’s requirement and the interviewer’s interest or sometimes that section will be skipped but still, it is always a good idea to understand all kinds of requirements and keep a note of both the requirements

Now once both types of requirements are listed at your end next step would be to understand the outcome of all the functional requirements which is generally the system or the components of the system let’s say one of the functional requirements was to have an API to book a ticket so naturally you will have a set of APIs which can support booking a ticket, canceling a ticket showing the history of tickets section, or it can be a set of some workers running a job a synchronously, or it can be two different components which are intracting with each other passing the information from one service to another and that information passing is either happening with APIs or Events or messaging. That’s how you break and design the functional requirements.

When it comes to non-functional requirements. Generally, the outcome of non-functional requirements can be like estimating how many users would the system serve, how many transactions per day have to happen, and then choosing the resources based on let’s say scale to 1 million requests and calculating how many servers would be needed and find out how many requests one server can serve and then do some calculations to come up with the final number of service. Let’s say you are trying to build a distributed key-value storage with storage capacity that is needed by one particular technology choice but it is not serving the amount of storage due to huge data and the technology that we need to be used has to be in consideration.

So non-functional requirements help capacity estimation and the system needs to be more highly available rather than consistent. As per the CAP theorem, we can pick from so many No Sequel Data Stores rather than sequel Data Store.

The outcome of Functional Requirements

the choices or decision-making steps that can help you once you understand the requirements and you can bifurcate the requirements into functional and non-functional, the outcome of functional requirements would be your system design diagram your component, and your architecture diagram.

The outcome of Non-Functional Requirements

the outcome of non-functional requirements after the series of capacity estimation, tech choices, and certain resources like what kind of data storage, what kind of servers or hardware, or different resources you would need to fulfill that architecture diagram on which the whole system is going to function.

Last but not least when you do go into the real world and build real-world systems functional requirements are something that comes from a product or user perspective or business perspective where the business needs certain features to be developed

The Outcome of Functional and Non-Functional Requirements

On the other hand, non-functional requirements would be part of more engineering-driven teams or more engineering-driven perspective or excellence, because those requirements define the performance of the system or how the system is fulfilling different SLOs or SLAs between the teams or with the final user or the end user.

In your free time pick any system like Book My Show Uber YouTube or Netflix anything and try to work backwards. Try to think about what would we give functional requirements of the system, or what are the functional requirements that the system is serving and what are the non-functional requirements that the system is serving and then once you do that try to think about your implementation to fulfill those requirements.

So that’s all about the Functional and Non-Functional requirementsfor now.
I’ll be sharing some resources, hope you find them useful Youtube:https://www.youtube.com/watch?v=xRdjEd-VQTU

Have a Safe life, Happy Coding, and Happy Learning😊

--

--

Kanishka Naik

Software Developer(JS, Go, Rust, Elixir)👨‍💻 | Tech Writer ✍️ | Astrophile🔭 | Stargazer 💫 | Available at https://www.linkedin.com/in/kanishka-naik-6b51