Recently updated: This post was originally published Dec. 11, 2020. It was refreshed on Nov. 4, 2022.
Over my 10 years as a senior software engineer and interviewer at Microsoft and Facebook, I’ve worked with hundreds of applicants as they solve different system design problems.
Software developers tend to struggle with System Design interview questions because they are so open-ended and often require a kind of critical thinking not practiced in other coding interview challenges.
While SDI questions change over time, some have remained popular in interviews across various top companies.
Today, we’ll explore the top 14 most commonly asked system design interview questions, common problems you’ll have to address in each, and some tools to help you do that.
Here’s what we’ll cover today:
Try one of our 400+ courses and learning paths: Grokking Modern System Design Interview for Software Engineers and Managers.
Start each problem by stating what you know: List all required features of the system, common problems you expect to encounter with this sort of system, and the traffic you expect the system to handle. The listing process lets the interviewer see your planning skills and correct any possible misunderstandings before you begin the solution.
Narrate any trade-offs: Every system design choice matters. At each decision point, list at least one positive and negative effect of that choice.
Ask your interviewer to clarify: Most system design questions are purposefully vague. Ask clarifying questions to show the interviewer how you’re viewing the question and your knowledge of the system’s needs.
Discuss emerging technologies: Conclude each question with an overview of how and where the system could benefit from machine learning. This will demonstrate that you’re not just prepared for current solutions but future solutions as well.
Know your architectures: Most modern services are built upon a flexible, microservice architecture. Unlike the monolithic architectures of tech companies in the past, microservices allow smaller, agile teams to build independently from the larger system. Some older companies will have legacy systems, but microservices can function in parallel to legacy code and help refresh the company architecture as a whole.
For more information on how ML can improve your SDI performance, check out How Machine Learning gives you an edge in System Design.
For this question, you’ll design a service that allows users to chat with each other over the internet. Conversations can be one-on-one or can be group chats with many members. Messages should only be accessible by those included in the conversation.
Functional requirements
Non-functional requirements
The high-level design for a messenger application is fairly simple. A user contacts a chat server and sends a message. The chat server relays the message to the user it was intended for, and then stores the message in a database. Once the message is delivered, the server notifies the sender that the message was successfully transmitted.
This question asks you to create a ride-sharing service that matches users with nearby drivers. Users can input a destination and transmit their current location and nearby drivers are notified within seconds.
The app then tracks a route between the driver and user’s current locations, then from the user’s location to the destination.
Functional requirements:
Non-functional requirements:
Plan to scale: It is of great interest to potential employers that you understand how to flexibly scale the infrastructure of a web application. Learn the basics of scalable systems.
At its simplest, the system should accept ride requests from users and return driver and trip information. When a driver matches with a rider, the application should return the trip and rider information. The driver’s location should regularly be recorded and communicated to relevant users.
Check out our guide to designing Uber’s backend for more information on Uber interview process.
bit.ly
This question asks you to create a program that shortens long URLs like TinyURL or bit.ly.
These programs take a long URL and generate a new and unique short URL. They can also take a shortened URL and return the original full-length URL.
Functional requirements:
Non-functional requirements:
A load balancer will serve as an intermediary between the clients and server, and a rate limiter should prevent flooding and exploitation. A sequencer will provide unique IDs for each URL that serve as the starting point for URL shortening. A base58 encoder transforms these numeric IDs into a more readable alphanumeric form. The original URLs are stored in a database, with recently used ones available in a cache.
Learn how to solve this problem in our step-by-step guide Design TinyURl and Instagram
For this question, you’ll design a social media service used by my hundred thousand users like Instagram. Users should be able to view a newsfeed with posts by followed users and suggest new content the user may like.
Interviewers often want to hear you discuss the newsfeed in depth.
read
and write
focused nodes? Are there likely to be more read requests (users viewing posts) or write requests (users creating posts)?Learn how to solve this problem with our step-by-step guide Design TinyURL and Instagram
These social network sites operate on a forum-based system that allows users to post questions and links. For simplicity’s sake, we’ll focus more on designing Quora. It is unlikely that you’ll need to walk through the design of something like Reddit’s subreddit or karma system in an interview.
Functional requirements:
Non-functional requirements:
Users contact an application server via web server to post questions, answers, and comments. Images and videos are placed in blob storage, and the question/answer data are stored in a MySQL database. A machine learning engine can be used to rank answers that it deems valuable. A recommendation system should tailor content to an individual user’s interests, and it should be available for both online and offline services.
Get hands-on practice with all the top SDI questions. Educative’s courses are created by current developers to help you learn in half the time.
Grokking Modern System Design Interview for Software Engineers & Managers
Above, we discussed how to design a newsfeed for an application like Instagram, but for this question we will dive deeper into how the system is designed.
Instagram is a social media platform that allows users to post pictures and short videos. Posts can be indexed and searched through hashtags and location-based geotags.
Functional requirements:
Non-functional requirements:
From a high level, the system should support the upload and storage of multimedia content. Users should receive notifications for likes, follows, and comments. The core of the system is run by an API that performs the functional requirements and fulfills user requests. Since the data generated by the system is inherently relational, the design should include an SQL database that stores information as tables.
For this question, you’ll create a synchronous, cross-platform storage system like Dropbox. Users can store files and photos and access them from other devices.
Functional requirements:
Non-functional requirements:
The client side of the system should contain a service for splitting large files into smaller, more easily manageable chunks. These files are then sent to a processing queue that sends and receives requests to store metadata and ensure that files are synchronized between users and accounts. Files are stored in a cloud-based block storage platform, like Amazon S3. When a user wants to upload or download files they contact this storage service through a web server.
A collaborative editing service should let users remotely and simultaneously make changes to text documents. The changes should be displayed in real time. Much like other cloud-based services, documents should be consistently available to any logged-in user on any machine. Your solution must be scalable to support thousands of concurrent users.
Functional requirements:
Non-functional requirements:
All user requests are sent through the API gateway. These requests can then be fulfilled uniquely depending on the desired result. The following are the core requests that the API should be capable of handling.
You are tasked to create an online video streaming service like YouTube. The service will store and transmit hundreds of petabytes of video data. It must also store statistics (views, likes, number of views, etc.) and allow for users to post comments.
Your solution must be scalable to support thousands of concurrent users.
Two for one: When it comes to designing a video streaming service, YouTube and Netflix are very similar. If you know how to design one, you know how to design the other.
Functional requirements
Non-functional requirements:
Video uploads are first handled by a load balancer, and then delivered to an encoder. The encoder and transcoder split the video into different resolutions. These typically range from 140p to 1440p, but can go all the way up to 4k resolutions. All of these videos are stored in blob storage. Popular and recent uploads are held in a CDN. A content delivery network, or CDN, reduces latency when delivering video to users. In conjunction with colocation sites, the CDN stores and delivers requested data to users.
For this question, you’ll create an API rate limiter that caps the number of API calls a service can receive in a given time period to avoid an overload.
Interviewers can ask for this at various scales, from a single machine to an entire distributed network.
Functional requirements:
Non-functional requirements
A rate limiter should exist between a web server and an API server. When a client sends a request to the web server, the rate limiter is consulted. The rate limiter will determine if the request will be handled or throttled. If handled, the request is sent to the API server. If throttled, the request is denied.
A web crawler is a bot that methodically searches the world wide web (WWW) for content. It begins from a pool of seed URLs. These bots acquire content through crawling and then store it for later retrieval.
To fully address this problem, you should design a web crawler and suggest seed URLs to get the process started.
Functional requirements:
Non-functional requirements:
A web crawler begins by assigning a worker to a URL. Once the DNS is resolved, the worker sends the URL and IP address to an HTML fetcher to establish the connection. The URL and HTML content are extracted from the page and stored in the cache for processing. This content is then dedup tested to ensure that no duplicate content is transferred to blob storage. Once this cycle is complete for a single URL it moves on to the next address in the queue.
robots.txt
file to determine how frequently to revisit the site as part of the Robots Exclusion Protocol.For this question, you’ll design a proximity server that stores and reports the distance to places like restaurants. Users can search nearby places by distance or popularity. The database must store data for hundreds of millions businesses across the globe.
Functional requirements:
Non-functional requirements:
When a user searches for business information, the request is sent first to read servers that then route it to QuadTree servers. These QuadTree servers return third-party map information and business information from a relational database and key-value store. A segment producer breaks the third-party map into smaller sections that business locations are added to. Users that leave reviews contact a write server that ultimately delivers the content to the relational database.
Data structures: A QuadTree is a tree-based data structure that partitions 2D space into quadrants.
Typeahead suggestions are more commonly referred to as an autocomplete feature. They are an essential part of search engines and sophisticated distributed search components.
This service will partially complete search queries and display five suggestions to complete the query. It should adapt to highly searched content in real time and suggest that to other users.
For example, “Seahawks win the Super Bowl” would be suggested within minutes of the event occurring.
Functional requirements:
Non-functional requirements:
When a user starts typing a query, each individual character is sent to an application server. A suggestion service gathers the top N suggestions from a distributed cache, or Redis, and returns the list to the user. An alternate service takes the query, analytically ranks it, and stores it in a NoSQL database.
For this question you’ll design a service that can map the route between two locations. The system should map several optimal paths to a destination based on the mode of travel. Each route should display the total mileage and an estimated time of arrival.
Functional requirements
Non-functional requirements:
When a user accesses the system, a load balancer mediates their request. The three main live data services are close to the user to ensure low latency:
Try one of our 400+ courses and learning paths: Grokking Modern System Design Interview for Software Engineers and Managers.
These questions should help you understand the kinds of problems you’re expected to solve for a system design interview. Answering questions like these is the most effective interview preparation strategy.
There are plenty more system design concepts to address during your preparation for a real-world FAANG interview. To give you hands-on practice with these solutions, Educative has created Grokking Modern System Design Interview for Engineers & Managers. This course will give you detailed walkthroughs on essential system design concepts and other example questions, written by current industry interviewers.
By the end, you’ll know exactly what modern interviewers are looking for and what clarifying questions to ask for each question. You’ll also have extensive practice in explaining your tradeoff decisions.
Happy learning!
Join a community of 1.7 million readers. Enjoy a FREE, weekly newsletter rounding up Educative's most popular learning resources, coding tips, and career advice.