Home/Blog/System Design/System Design Interview Questions in 2024
Home/Blog/System Design/System Design Interview Questions in 2024

System Design Interview Questions in 2024

Fahim ul Haq
Sep 09, 2024
38 min read
content
Top 25 System Design Interview questionsEasy System Design Interview QuestionsTips for any SDI questionSystem Design Interview Cheat SheetEasy System Design Interview Questions1. Design an API rate limiter for sites like Firebase or GitHubRequirementsSystem Design and workflow2. Design a pub/sub system like KafkaRequirementsSystem Design and workflow3. Design a URL-shortening service like TinyURL or bit.lyRequirementsSystem Design and workflow4. Design a scalable content delivery network (CDN)RequirementsSystem Design and workflow5. Design a web crawlerRequirementsSystem Design and workflow6. Design a distributed cacheRequirementsSystem Design and workflowMedium System Design interview questions7. Design a chat service like Facebook Messenger or WhatsAppRequirementsSystem Design and workflow8. Design a mass social media service like Facebook or InstagramRequirementsSystem Design and workflow9. Design a proximity service like Yelp or nearby places/friendsRequirementsSystem Design and workflow10. Design a search engine-related service like TypeaheadRequirementsSystem Design and workflow11. Design a video streaming service like YouTube or NetflixRequirementsSystem Design and workflow12. Design a ride-sharing service like Uber or LyftRequirementsSystem Design and workflow13. Design a recommendation serviceRequirementsSystem Design and workflow14. Design a file-sharing service like Google DriveRequirementsSystem Design and workflow15. Design a social network service like Reddit or QuoraRequirementsSystem Design and workflowHard System Design interview questions16. Design a social media newsfeed serviceRequirementsSystem Design and workflow17. Design a collaborative editing service like Google Docs RequirementsSystem Design and workflow18. Design Google MapsRequirementsSystem Design and workflow19. Design a payment gateway like StripeRequirementsSystem Design and workflow20. Design a food-delivery service like Uber Eats or DoorDashRequirementsSystem Design and workflow21. Design a distributed locking service like Google Chubby lockingRequirementsSystem Design and workflow22. Design a coordination system like ZooKeeperRequirementsSystem Design and workflow23. Design a scalable distributed storage system like BigtableRequirementsSystem Design and workflow24. Design an online multiplayer game systemRequirementsSystem Design and workflow25. Design video conference serviceRequirementsSystem Design and workflowThe final step of your interview prepContinue reading about System Design InterviewsRelated courses
share
Video thumbnail
System Design Interview Questions

Over my 10+ years as a systems engineer and hiring manager at Microsoft and Facebook, I led hundreds of software engineer candidates through System Design interviews.

Surprisingly, I found that even the best developers often struggled with System Design problems. Why? I think it's because System Design questions can be open-ended, and therefore require creativity and problem solving skills not practiced in other coding interview challenges.

While SDI questions tend to evolve over time, many have remained popular across the industry. These questions are well-suited to evaluate candidates on two important levels:

  1. Test the candidate's understanding of System Design fundamentals

  2. Evaluate the candidate's ability to apply those fundamentals in real-world applications

Today, we’ll break down the top 25 System Design Interview questions for 2024. These are essential questions asked at top companies like Google, Amazon, Meta, and more. Mastering these problems, and their solutions, will give you a huge leg up in your System Design interview prep.

Finally, I will leave you with a few battle-tested strategies that you can use to confidently take on any System Design question you encounter.

Top 25 System Design Interview questions#

I have divided these 25 essential System Design problems into three difficulty levels:

Easy System Design Interview Questions#

  1. Design an API rate limiter for sites like Firebase or GitHub

  2. Design a pub/sub system like Kafka

  3. Design a URL-shortening service like TinyURL or bit.ly

  4. Design a scalable content delivery network (CDN)

  5. Design a web crawler

  6. Design a distributed cache

Medium System Design Interview Questions

  1. Design a chat service like Facebook Messenger or WhatsApp

  2. Design a mass social media service like Facebook or Instagram

  3. Design a proximity service like Yelp or nearby places/friends

  4. Design a search engine-related service like Typeahead

  5. Design a video streaming service like YouTube or Netflix

  6. Design a ride-sharing service like Uber or Lyft

  7. Design a recommendation service

  8. Design a file-sharing service like Google Drive

  9. Design a social network and message board like Reddit or Quora

Hard System Design Interview Questions

  1. Design a social media newsfeed service

  2. Design a collaborative editing service like Google Docs

  3. Design Google Maps

  4. Design a payment gateway like Stripe

  5. Design a food-delivery service like Uber Eats or DoorDash

  6. Design a distributed locking service like Google Chubby locking

  7. Design a coordination system like ZooKeeper

  8. Design a scalable distributed storage system like Bigtable

  9. Design an online multiplayer game system

  10. Design video conference service

Before we start breaking down specific questions, I want to give you some high-level System Design tips that will enable you to confidently approach any problem.

Tips for any SDI question#

  • 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 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 view the question and your knowledge of the system’s needs. Also be sure to state your assumptions before diving into the components.

  • 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 parallel to legacy code and help refresh the company architecture.

  • 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 prepared for not only current solutions but also future solutions.

Cover
Grokking the Modern System Design Interview

System Design interviews are now part of every Engineering and Product Management Interview. Interviewers want candidates to exhibit their technical knowledge of core building blocks and the rationale of their design approach. This course presents carefully selected system design problems with detailed solutions that will enable you to handle complex scalability scenarios during an interview or designing new products. You will start with learning a bottom-up approach to designing scalable systems. First, you’ll learn about the building blocks of modern systems, with each component being a completely scalable application in itself. You'll then explore the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process. Finally, you'll design several popular services by using these modular building blocks in unique combinations, and learn how to evaluate your design.

26hrs
Intermediate
5 Playgrounds
18 Quizzes

Note: For info on how ML can boost your SDI performance, check out my blog How Machine Learning gives you an edge in System Design.

System Design Interview Cheat Sheet#

Here is the system design interview cheat sheet

System Design Interview Cheat Sheet
System Design Interview Cheat Sheet

Now let's dive into the specifics of the top System Design Interview questions, starting with the easy-level problems.

Easy System Design Interview Questions#

1. Design an API rate limiter for sites like Firebase or GitHub#

Problem statement: Design an API rate limiter that caps the number of API calls the service can receive in a given period to avoid an overload.

Requirements#

Follow these requirements for a rate limiter system:

Functional requirements

  • Limit requests
  • Configurable
  • Error or notification if the limit is reached

Nonfunctional requirements

  • Availability
  • Low latency
  • Scalability

System Design and workflow#

According to the following high-level rate limiter, the client’s requests are passed through an ID builder, which assigns unique IDs to the incoming requests. The ID could be a remote IP address, login ID, or other attributes. The decision maker fetches the throttling rules from the database and decides according to them. It either forwards the requests to application servers via the requests processor or discards them and provides the client an error message (429 Too many requests). If some requests are throttled due to a system overload, the system keeps those requests in a queue to be processed later.

A high-level design of a rate limiter
A high-level design of a rate limiter

Knowledge test!

  • How does your system measure requests per minute? If a user makes 10 requests at 00:01:20 and then another 10 at 00:02:10, they’ve made 20 in the same one-minute window despite the minute change.

  • In the event of a failure, a rate limiter would be unable to perform the task of throttling. Should the request be accepted or rejected in such a scenario?

  • What changes would you make to the design while considering the rate limiter design for a distributed system rather than a local one?

Note: Look at the detailed design of the rate limiter to find the answers to the questions above.

2. Design a pub/sub system like Kafka#

Problem statement: Design a scalable and distributed pub/sub system like Kafka that can handle massive message throughput. It should also ensure reliable message delivery and support various messaging semantics (at most once, at least once, exactly once).

Requirements#

Follow these requirements for the pub/sub design:

Functional requirements

  • Create a topic
  • Write messages
  • Subscription
  • Read messages
  • Specify retention time
  • Delete messages

Nonfunctional requirements

  • Availability
  • Scalability
  • Durability
  • Fault-tolerant
  • Concurrency management for simultaneous reads and writes

System Design and workflow#

The brokers are responsible for storing the messages sent from the producers and allowing the consumer to read them. Similarly, the cluster manager is to keep an eye on the broker’s health and to spin another broker in case one goes down. The consumer’s details include subscription information, retention period, etc. The consumers are managed by the consumer manager, who manages consumers’ access to messages in the existing topics.

A high-level design of a pub/sub system
A high-level design of a pub/sub system

Knowledge test!

  • How can message delivery be ensured and semantics guaranteed at least once or at most once in the pub/sub design?

  • How can you guarantee message orders for specific consumers?

Note: To answer the above technical questions, you can examine the detailed design of pub/sub.

3. Design a URL-shortening service like TinyURL or bit.ly#

Problem statement: Design a scalable and distributed system that shortens long URLs like TinyURL or bit.ly. The system takes a long URL and generates a new, unique short URL. It should also take a shortened URL and return the original full-length URL.

Requirements#

Follow these requirements for the URL-shortening system:

Functional requirements

  • URL generation
  • URL storage
  • Redirection to the original URL
  • Customization of URLs
  • Update and delete URLs

Nonfunctional requirements

  • Scalability
  • Availability
  • Unpredictability in URL generation
  • Readability
  • Low latency

System Design and workflow#

A load balancer is the first intermediary between the clients and the server, ensuring even distribution of incoming requests to maintain availability and reliability. When a new URL-shortening request comes in, the load balancer forwards it to a server where the rate limiter checks if the client is within the allowed request rate.

The server leverages a sequencer to generate a unique numeric ID for the URL requests. This ID is passed to an encoder, which converts it into a more readable alphanumeric string. The original URL and its corresponding shortened version are stored in a database. To enhance performance, recently accessed URLs are kept in a cache, allowing quick retrieval without repeatedly querying the database.

A high-level design of a URL-shortening service
A high-level design of a URL-shortening service

Knowledge test!

  • What if two users input the same custom URL?

  • What if there are more users than expected?

  • How does the database regulate storage space?

Note: To explore in depth to get the answer to the above questions, check out the detailed chapters on the TinyURL System Design.

4. Design a scalable content delivery network (CDN)#

Problem statement: Design a scalable content delivery network (CDN) system to efficiently distribute and cache content across globally distributed servers, minimizing latency and ensuring reliable end user content delivery.

Requirements#

Follow these requirements for a CDN system:

Functional requirements

  • Retrieve content from the origin server
  • Respond to user requests
  • Auto-content delivery from the origin server
  • Search
  • Update content from origin or peer CDNs

Nonfunctional requirements

  • Scalability
  • Availability
  • Reliability
  • Security
  • Low latency

System Design and workflow#

When a client requests content, a request routing system kicks in to find the address of the nearest or fastest server, ensuring minimal wait time. A load balancer then routes the request to this optimal server. If the requested content is cached on that server, it is immediately delivered to the client. If not, the server fetches the content from the origin server, caches it locally for more such requests, and then serves it to the user.

The CDN system ensures that frequently accessed content remains readily available while less popular content is periodically purged. The system also includes monitoring and analytics to track performance, optimize routing, and ensure high availability and reliability.

A high-level design of a CDN
A high-level design of a CDN

Knowledge test!

  • How would you determine which content to be cached on edge servers?

  • How would you distribute traffic evenly across multiple edge servers?

  • How would you ensure the CDN infrastructure’s scalability, availability, and fault tolerance?

  • How would you optimize the delivery and reduce the latency while streaming?

Note: Check out the chapter on the design of a content delivery network to help you understand and get answers to the above questions.

5. Design a web crawler#

Problem statement: Design a web crawler that systematically browses the internet to discover and index web pages. The crawler should efficiently navigate websites, retrieve content, and follow links to discover new pages.

Requirements#

Follow these requirements for the web crawler system:

Functional requirements

  • Crawling
  • Storing crawled content
  • Scheduling for periodic crawling

Nonfunctional requirements

  • Scalability
  • Consistency
  • Reliability
  • Extensibility to network protocols

System Design and workflow#

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 tested by duplicate eliminator service to ensure 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.

A high-level design of a web crawler
A high-level design of a web crawler

Knowledge test!

  • What functionalities must be added to extract all formats (images and video)?

  • Real web crawlers have multiple workers handling separate URLs simultaneously. How does this change the queuing process?

  • How can you account for crawler traps?

Note: To get the answers to the above questions, check out the detailed chapters on the web crawler System Design.

6. Design a distributed cache#

Problem statement: Design a distributed caching system that provides fast, scalable, and reliable data retrieval across multiple servers. The system should efficiently manage cache consistency, handle high volumes of read and write requests, ensure data availability, and provide mechanisms for cache eviction and expiration.

Requirements#

Follow these requirements for the distributed cache system:

Functional requirements

  • Insert or write data
  • Retrieve data
  • Data partitioning
  • Cache eviction

Nonfunctional requirements

  • Scalability
  • Consistency
  • Low latency
  • High availability

System Design and workflow#

A distributed caching system begins by partitioning the data across multiple cache nodes to balance the load and improve access speed. When a client requests data, an application server determines the appropriate cache node based on a consistent hashing algorithm, ensuring an even distribution of requests and quick lookups.

If the data is found in the cache (a cache hit), it is returned to the client immediately, significantly reducing latency. If the data is not found (a cache miss), the system retrieves it from the primary data store, caches it, and then serves it to the client. Cache eviction policies, such as least recently used (LRU) or time-to-live (TTL), manage the removal of stale data to free up space.

A high-level design of a distributed cache
A high-level design of a distributed cache

Knowledge test!

  • How do you ensure data consistency across multiple cache nodes, especially during updates and deletions?

  • What strategies can be implemented to handle cache misses efficiently without overloading the primary data store?

  • What methods can maintain low latency and high throughput under heavy load conditions?

  • How do you secure the cache data against unauthorized access and ensure privacy?

Note: To answer such conceptual questions, check out the detailed design of the distributed cache.

Medium System Design interview questions#

7. Design a chat service like Facebook Messenger or WhatsApp#

Problem statement: Design a scalable, reliable, and secure real-time chat service like Facebook Messenger or WhatsApp to support instant messaging, group chats, notifications, and multimedia sharing.

Requirements#

Follow these requirements for the WhatsApp System Design:

Functional requirements

  • Real-time communication (individual/group)
  • Message delivery acknowledgment
  • Sharing of media content
  • Chat storage
  • Notifications

Nonfunctional requirements

  • Availability
  • Low latency
  • Scalability
  • Consistency
  • Security

System Design and workflow#

In a real-time communication system, senders and receivers are connected to chat servers. Chat servers deliver messages from sender to receiver via a messaging queue. Various protocols, such as WebSocket, XMPP, MQTT, and real-time transport protocol, can be utilized for real-time communication. For this purpose, a manager establishes real-time connections between clients and chat servers; for instance, assume the WebSocket manager to establish WebSocket connections between users and different chat servers. Similarly, the messages can be persistently stored in the database.

A high-level design of a real-time chat system
A high-level design of a real-time chat system

Knowledge test!

  • What happens if a message is sent when the user isn’t connected to the internet? Is it sent when the connection is restored?

  • How will you encrypt and decrypt the message without increasing latency?

  • How do users receive notifications?

  • Are messages pulled from the device (the server periodically prompts the devices if they’re waiting to send a message) or are pushed to the server (the device prompts the server that it has a message to send)?

Note: Look at the detailed design of real-time chat service to get answers to such questions.

8. Design a mass social media service like Facebook or Instagram#

Problem statement: Design a social media service used by several million users like Instagram. Users should be able to view a newsfeed with posts by following users and suggesting new content the user may like.

Requirements#

Follow these requirements for the Instagram system:

Functional requirements

  • Create a post
  • Delete a post
  • Edit a post
  • Share a post
  • Follow and unfollow users
  • Search for content
  • View the system’s generated feed
  • Like and dislike posts

Nonfunctional requirements

  • Scalability
  • Availability
  • Low latency
  • Reliability
  • Security

Based on the above requirements, let’s create a high-level design of a feed-based social system like Instagram.

System Design and workflow#

The high-level design of a feed-based social network includes posts, timeline generation, feed publishing service, and feed ranking and recommendation engine. The post-service handles the clients’ posts, and the post is published on the client’s wall (page). Similarly, the timeline generation service generates feeds for friends and followers by the timeline generation service. The timeline generation service utilizes the feed ranking and recommendation engine, which ranks and recommends the top N posts to followers based on their interests, searches, and watch history. The generated feed is stored in the database, and the feed publishing service is responsible for publishing and showing the generated feeds to followers. Since the feed could contain videos, the CDN is responsible for delivering the videos to followers with low latency.

A high-level design of mass social media service
A high-level design of mass social media service

Knowledge test!

  • Influencers or celebrities will have millions of followers; how are they handled vs. standard users?

  • How does the system weight posts by age? Old posts are less likely to be viewed than new posts.

  • What’s the ratio of read and write focused nodes? Are there likely to be more read requests (users viewing posts) or write requests (users creating posts)?

  • How can you increase availability? How does the system update? What happens if a node fails?

  • How do you efficiently store posts and images?

Note: Look at the detailed design of Instagram for better understanding.

9. Design a proximity service like Yelp or nearby places/friends#

Problem statement: 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 of businesses across the globe.

Requirements#

Follow these requirements for a System Design like Yelp:

Functional requirements

  • User accounts
  • Search
  • Feedback

Nonfunctional requirements

  • Scalability
  • High availability
  • Consistency
  • Performance

System Design and workflow#

The system handles search requests by using load balancers to distribute read requests to the read service, which then queries the quadtree service to identify relevant places within a specified radius. The quadtree service also refines the result before being sent to the clients. For adding places or feedback, write requests are similarly routed through load balancers to the writing service, which updates a relational database and stores images in blob storage. The system also involves segmenting the world map into smaller parts, storing places in a key-value store, and periodically updating these segments to include new places, although this update happens monthly due to the low probability of new additions.

A high-level design of proximity service like Yelp
A high-level design of proximity service like Yelp

Knowledge test!

  • How do you store lots of data and retrieve search results quickly?

  • How should the system handle different population densities? RigidA fixed, inflexible grid structure used to divide geographic space into latitude and longitude coordinates latitude/longitude grids will cause varied responsiveness based on density.

  • Can we optimize commonly searched locations?

Note:  Look at the detailed design of Yelp to get answers to the above questions.

Problem statement: Design a typeahead suggestion system that provides real-time, relevant autocomplete and autocorrect suggestions as users type, ensuring low latency and scalability to efficiently handle a large volume of queries.

Requirements#

Follow these requirements for the system:

Functional requirements

  • Autocomplete
  • Autocorrect

Nonfunctional requirements

  • Scalability
  • Fault tolerance
  • Performance

System Design and workflow#

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 called the data collector and aggregator takes the query, analytically ranks it, and stores it in a NoSQL database. The trie builder is a service that takes the aggregated data from the NoSQL database, builds tries, and stores them in the trie database.

A high-level design of Typeahead
A high-level design of Typeahead

Knowledge test!

  • How strongly do you weigh spelling mistake corrections?

  • How do you update selections without causing latency?

  • How do you determine the most likely completed query? Does it adapt to the user’s searches?

  • What happens if the user types very quickly? Do suggestions only appear after they’re done?

Note: Look at the detailed design of Typeahead system for a better understanding of the system.

11. Design a video streaming service like YouTube or Netflix#

Problem statement: Design a video streaming service like YouTube or Netflix that allows users to upload and stream videos. The service should efficiently store many videos and their metadata and return accurate and quick results for user search queries.

Requirements#

Follow these requirements for a streaming service System Design:

Functional requirements

  • Search videos
  • Upload videos
  • Stream videos
  • Rate videos

Nonfunctional requirements

  • Availability
  • Scalability
  • Low latency (to stream a video)
  • Support multiple formats

System Design and workflow#

A load balancer first handles video upload requests by sending them to the application servers. The applications server interacts with the video service which triggers transcoders to convert the video to different formats. These typically range from 140p to 1440p but can reach 4K resolutions. The formatted video is then saved to the blob store, and its metadata is stored on the metadata database. The video service sends the transformed video to CDNs for quick content delivery to end users. 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.

A high-level design of a video streaming system
A high-level design of a video streaming system

Knowledge test!

  • How will your service ensure smooth video streaming on various internet qualities?

  • How are the videos stored?

  • How will the system provide a personalized experience to each user with recommendations?

  • How does the system react to a sudden drop in the network, shifting to low-quality, buffering content, etc.?

Note: Check out the detailed chapter on YouTube System Design that answers the above concerns during the design.

12. Design a ride-sharing service like Uber or Lyft#

Problem statement: Design a system for a ride-sharing service similar to Uber, where users can request rides and drivers can accept these requests. The system should efficiently match drivers to riders based on location and availability, handle real-time updates on ride statuses, manage payments securely, and ensure a smooth user experience from booking to completion of the ride.

Requirements#

Follow these requirements for the System Design:

Functional requirements

  • Location tracking
  • Request a ride
  • Show nearby drivers
  • Calculate and notify ETA
  • Trip process (confirmation and updates)
  • Payment

Nonfunctional requirements

  • Scalability
  • Availability
  • Reliability
  • Low latency
  • Consistency
  • Security

System Design and workflow#

A user’s request is sent to the application server via a load balancer and API gateway. The system accepts the rider’s request and the trip service or manager provides an estimated time of arrival (ETA) based on different vehicle types. The drivers and location manager use a matching algorithm to find the nearest available drivers and send the request to those drivers by notifying them via a notification service. When a driver matches with a rider, the application should return the trip and rider information. The driver’s location is regularly recorded and communicated to relevant users through a pub-sub service.

Once the ride is complete, the trip manager ensures payment is securely processed through a payment gateway. We leverage a database that stores user and driver profiles, ride history, and payment information. We also use caching mechanisms to speed up access to frequently requested data, and constant monitoring ensures the service runs smoothly.

A high-level design of a ride-hailing service
A high-level design of a ride-hailing service

Knowledge test!

  • How can you keep latency low during busy periods?

  • How is the driver paired with the user? Iterating all drivers to find Euclidean distance would be inefficient.

  • What happens if the driver or user loses connection?

  • How would you update the ETA during a ride in peak hours?

Note: Check out our guide to designing Uber’s backend for more information on the Uber interview process.

13. Design a recommendation service#

Problem statement: Design a recommendation engine that suggests personalized content or products to users based on their preferences and behavior. The system should efficiently analyze user data, such as past interactions and ratings, to provide accurate and relevant recommendations.

Requirements#

Follow these requirements for a recommendation service:

Functional requirements

  • Search and browse
  • Personalized recommendations
  • Real-time update of recommendations
  • Offline processing

Nonfunctional requirements

  • Scalability
  • Low latency
  • Privacy
  • Security

System Design and workflow#

The recommendation engine’s System Design comprises two stages: data collection, data processing, and recommendation. When users interact with the application, the data collector service collects data from application servers, such as search, viewing history, ratings, watch times, etc. This data is logged into Kafka for immediate processing.

We use real-time processors to process data and recommend content accordingly. We also use batch processors for periodic offline processing to perform detailed analyses and improve accuracy. Once the data is processed, the ML/AI engine uses different algorithms, such as collaborative filtering, content-based filtering, hybrid approaches, and some advanced techniques to recommend personalized suggestions.

A high-level design of a recommendation system
A high-level design of a recommendation system

Knowledge test!

  • How will you handle the cold start problem for new users and content?

  • How would you update recommendations in real time?

  • How would you ensure the recommendation system scales to ever-increasing users?

  • What strategies would you employ to adjust recommendations dynamically based on real-time changes in user behavior or preferences?

  • How can you optimize recommendation accuracy without compromising on scalability and performance?

You can check out the following course for more details!

Cover
Grokking the Modern System Design Interview

System Design interviews are now part of every Engineering and Product Management Interview. Interviewers want candidates to exhibit their technical knowledge of core building blocks and the rationale of their design approach. This course presents carefully selected system design problems with detailed solutions that will enable you to handle complex scalability scenarios during an interview or designing new products. You will start with learning a bottom-up approach to designing scalable systems. First, you’ll learn about the building blocks of modern systems, with each component being a completely scalable application in itself. You'll then explore the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process. Finally, you'll design several popular services by using these modular building blocks in unique combinations, and learn how to evaluate your design.

26hrs
Intermediate
5 Playgrounds
18 Quizzes

14. Design a file-sharing service like Google Drive#

Problem statement: Design a scalable and synchronous, cross-platform storage system like Dropbox. Users can store files and photos and access them from other devices.

Requirements#

Follow these requirements for the system:

Functional requirements

  • Upload and download files
  • Share files
  • Synchronize across devices

Nonfunctional requirements

  • Scalability and consistency
  • Low latency

System Design and workflow#

In a high-level design of a file-sharing service like Google Drive, the user’s request to upload or download a file passes through a load balancer to the application servers. The application server sends the upload request to a chunk 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 (or in-premises blob storage). When a user wants to upload or download files, they contact this storage service through a web server.

A high-level design of a file-sharing service
A high-level design of a file-sharing service

Knowledge test!

  • Where are the files stored?

  • How do you handle updates? Do you re-upload the entire file again?

  • Do small updates require a full file update?

  • How does the system handle two users updating a document simultaneously?

Note: To further your learning, explore the detailed design of distributed file systems of tech giants like Google and Facebook (Meta).

15. Design a social network service like Reddit or Quora#

Problem statement: These social network sites operate on a forum-based system that allows users to post questions and links. For simplicity’s sake, 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.

Requirements#

Follow these requirements for a System Design like Quora:

Functional requirements

  • Post questions and answers
  • Vote and comment
  • Search
  • Answer ranking
  • Recommendation system

Nonfunctional requirements

  • Scalability and consistency
  • Availability
  • Performance

System Design and workflow#

In Quora’s high-level design, users interact through a web server, which communicates with an application server to handle actions such as posting questions, answers, and comments. Content like images and videos is stored in blob storage, and question-and-answer data, along with user profiles and interactions, are stored in a MySQL database.

A machine learning engine analyzes user interactions and content to rank answers based on relevance and quality. This engine continuously learns from user feedback to improve its ranking algorithms. For personalized user experiences, a recommendation system utilizes machine learning models to tailor content based on individual interests and behaviors.

A high-level design of Quora
A high-level design of Quora

Knowledge test!

  • How can you ensure the system’s scalability to handle millions of simultaneous users posting questions and answers?

  • What strategies can efficiently store and retrieve large multimedia content in blob storage?

  • How would you design the database schema to manage the relationships between users, questions, answers, and comments in a scalable way?

  • What techniques can be used to rank answers effectively, ensuring that high-quality content is prioritized for users?

  • How can you optimize the performance of the machine learning engine to rank answers quickly and accurately?

Note: Check out the detailed chapter on Quora System Design to help you understand the system.

Hard System Design interview questions#

16. Design a social media newsfeed service#

Problem statement: Design a scalable and efficient social media newsfeed system that delivers personalized, real-time content updates to users, ensuring low latency, high availability, and scalability.

Requirements#

Follow these requirements for the design:

Functional requirements

  • Newsfeed generation
  • Newsfeed contents
  • Newsfeed display

Nonfunctional requirements

  • Scalability
  • Fault tolerance
  • Availability
  • Low latency

System Design and workflow#

In the following high-level design of a newsfeed system, clients post or request their newsfeed through the app, which the load balancer redirects to a web server for authentication and routing. Whenever a post is created via the post service and available from the friends (or followers) of a user, the notification service informs the newsfeed generation service, which generates newsfeeds from the posts of the user’s friends (followers) and keeps them in the newsfeed cache. Similarly, the generated feeds are published by the newsfeed publishing service to the user’s timeline from the news feed cache. If required, it also appends multimedia content from the blob storage with a news feed.

A high-level design of newsfeed service
A high-level design of newsfeed service

Knowledge test!

  • The creation and storage of newsfeeds for each user in the cache requires an enormous amount of memory. Is there any way to reduce this memory consumption?

  • What mechanisms would you implement to prioritize and filter content in the newsfeed to prevent information overload for users?

  • How can the system ensure consistency and order of posts in the newsfeed, especially in a distributed environment with multiple data centers?

Note: If you need answers to such questions, look at the detailed design of a newsfeed service.

17. Design a collaborative editing service like Google Docs #

Problem statement: Design a collaborative editing service that lets 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.

Requirements#

Follow these requirements for the Google Docs system:

Functional requirements

  • Collaboration
  • Edit overlap
  • Autocomplete and grammatical suggestions
  • History and view count
  • Manage documents

Nonfunctional requirements

  • Consistency
  • Availability
  • Low latency

System Design and workflow#

Clients’ requests are forwarded to the operations queue, where conflicts are resolved between different collaborators, and the data is stored in the time series database and blob storage (responsible for storing media files). Autocomplete suggestions are made via the typeahead service. This service resides on the Redis cache to enable low latency suggestions and enhance the speed of the regular updates process. The application servers perform a number of important tasks, including importing and exporting documents. Application servers also convert documents from one format to another. For example, a .doc or .docx document can be converted into .pdf or vice versa.

A high-level design of Google Docs service
A high-level design of Google Docs service

Knowledge test!

  • How do you minimize latency when multiple users are distant from the server?

  • What techniques for conflict resolution are best for ensuring consistency?

Note: If you need answers to such questions, look at the detailed design of Google Docs.

18. Design Google Maps#

Problem statement: 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.

Requirements#

Follow these requirements for the Google Maps system:

Functional requirements

  • Real-time navigation
  • Location/Area search
  • Route search/finder
  • Route planning
  • Real-time notification

Nonfunctional requirements

  • Scalability
  • Reliability
  • Low latency
  • Accuracy

System Design and workflow#

In the Google Maps system, clients request location-based services, such as finding a route or searching for nearby points of interest. The load balancer directs requests to various services based on the nature of the query.
For routing requests, the route finder service calculates optimal paths between two or more points using real-time and historical data. It relies on the graph processing service to perform complex calculations on the road network graph stored in the graph database. The location finder service provides the user’s current location or identifies the location of a specified point of interest. The area search system enables users to find nearby places, such as restaurants or gas stations, by querying both the graph database and third-party road data sources.

A high-level design of Google Maps system
A high-level design of Google Maps system

Knowledge test!

  • How do you collect the world map data? What third-party source will you use?

  • How do you segment the map to avoid long loading times?

  • How do you ensure the accuracy of ETA calculations for high-traffic times of day?

Note: Look at the detailed design of Google Maps to get answers to the questions above.

19. Design a payment gateway like Stripe#

Problem statement: Design a payment gateway like Stripe capable of securely performing online or card transactions and handling millions of users simultaneously.

Requirements#

Follow these requirements for the system:

Functional requirements

  • User registration and authentication
  • Payment processing
  • Transaction history
  • Balance management
  • Mobile accessibility

Nonfunctional requirements

  • Performance
  • Availability
  • Reliability
  • Data integrity and security
  • Scalability

System Design and workflow#

Initially, a customer selects a product or service via the merchant’s online store and proceeds to the checkout page to provide their payment details, including card number, cardholder name, CVV or CVC, and expiration date. Upon clicking the pay button, an event is generated that hits the payment service, which stores the event, performs initial security checks, and forwards the payment details to the payment service provider for further operations. The payment gateway performs extensive security checks, moves money from the customer’s account to the merchant’s, and provides secondary services like handling refunds and generating invoices. The card network verifies the card information via APIs provided by the card network. Once the payment is processed, the wallet and ledger service updates the merchant’s wallet in the database to track total revenue and processes each order separately in case of multiple sellers. The reconciliation system matches and verifies financial records to ensure accurate transaction accounting, identifying and resolving any discrepancies.

A high-level design of payment gateway
A high-level design of payment gateway

Knowledge test!

  • Where are the customer’s payment details encrypted during a purchase?

  • How does the card network authorize a debit/credit card?

You can check out the following course for more details on System Design:

Cover
Grokking the Modern System Design Interview

System Design interviews are now part of every Engineering and Product Management Interview. Interviewers want candidates to exhibit their technical knowledge of core building blocks and the rationale of their design approach. This course presents carefully selected system design problems with detailed solutions that will enable you to handle complex scalability scenarios during an interview or designing new products. You will start with learning a bottom-up approach to designing scalable systems. First, you’ll learn about the building blocks of modern systems, with each component being a completely scalable application in itself. You'll then explore the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process. Finally, you'll design several popular services by using these modular building blocks in unique combinations, and learn how to evaluate your design.

26hrs
Intermediate
5 Playgrounds
18 Quizzes

20. Design a food-delivery service like Uber Eats or DoorDash#

Problem statement: Design a food-delivery service like Uber Eats or DoorDash that efficiently connects hungry customers with diverse restaurants, ensuring timely and accurate order fulfillment while optimizing delivery routes and driver earnings.

Requirements#

Follow these requirements for the DoorDash system:

Functional requirements

  • Search menu items, cuisines, or restaurants
  • Add items to the cart
  • Notifications about the order status
  • Track the order
  • Cancel the order
  • Pay for the order
  • Create and update the account
  • Restaurant profile creation
  • Offboarding option (If the restaurant decides to discontinue service)

Nonfunctional requirements

  • Latency
  • Consistency
  • Availability
  • High throughput

System Design and workflow#

The following is a level design of DoorDash consisting of several services for different purposes. Let’s describe the workflow and the interaction of the different services involved in the design.

Customers’ requests are routed through the API gateway and directed to different services via the load balancer. The search service searches for menu items, cuisines, restaurants, etc. It is one of the busiest services most customers use when searching the website or application. The ordering service handles menu selection, managing the shopping cart, and placing food orders. Additionally, it facilitates payment processing through an external payment gateway and stores the outcomes in the relevant database. The order fulfillment service is used to manage the orders that the restaurants have accepted. It also keeps track of orders being prepared.

Customers and restaurant staff use the user management service to create and manage their profiles. The dispatch service displays the orders ready to be picked. It is also used to view delivery information and facilitate communication between customers and restaurant staff.

A high-level design of DoorDash system
A high-level design of DoorDash system

Knowledge test!

  • How would you handle a sudden surge in orders during peak hours, like on Super Bowl Sunday?

  • How would you leverage customer and delivery data to personalize recommendations, improve order accuracy, and optimize pricing?

  • How would you protect sensitive customer and payment information from breaches?

21. Design a distributed locking service like Google Chubby locking#

Problem statement: Design a highly available, fault-tolerant distributed locking service like Google Chubby to coordinate access to shared resources in a large-scale distributed system.

Requirements#

Follow these requirements for the Google Chubby locking system:

Functional requirements

  • Coarse-grained locking service
  • Reliable low-volume storage

Nonfunctional requirements

  • Availability
  • Reliability
  • Easy-to-understand semantics
  • High throughput

System Design and workflow#

The Chubby cell is composed of multiple servers (usually five), all replicas of each other. One of these servers is a leader with whom the clients must communicate. Each server has a namespace that is composed of directories and files that contain data that is relevant to different applications. In addition to this namespace, the server contains an ACLAccess Control List: A list that tells which processes or people can be given what kind of access to computational resources. files directory to have access control lists of all the files and directories within the namespace. The Chubby library mediates communication between clients and servers in a Chubby cell. It takes a request from a client who wants to use Chubby service and then finds the relevant cell, directs the request to that cell via remote procedure calls (RPCs), and then reports any changes made in the namespace, data, or metadata (also known as events) back to the client.

A high-level design of the Google Chubby locking system
A high-level design of the Google Chubby locking system

Knowledge test!

  • How does Chubby recover from server failures and network partitions while maintaining data consistency?

  • How does Chubby handle client failures and session timeouts?

Note: Look at the detailed design of Google Chubby locking to get answers to the above questions.

22. Design a coordination system like ZooKeeper#

Problem statement: Design a highly available, fault-tolerant, and scalable coordination system like ZooKeeper to manage configuration, naming, synchronization, and group services in a distributed system.

Requirements#

Follow these requirements for the ZooKeeper system:

Functional requirements

  • Coordination and synchronization of processes
  • Leader election
  • Ephemeral node creation and deletion
  • Session management
  • Efficient reads and writes
  • Session management

Nonfunctional requirements

  • Good performance
  • Simple design
  • Availability
  • Reliability

System Design and workflow#

The clients are the applications that use ZooKeeper as a coordination service for their application processes. ZooKeeper client library (API) provides functions such as create()delete()exists(), and many more to manage and use the coordination data. Through this API, the client request is forwarded to the ZooKeeper server. The ZooKeeper server represents a process that provides the ZooKeeper coordination service. It stores all the coordination data from different applications and their processes in memory. The namespace for applications/clients and their coordination data are organized in a hierarchy (in the form of a tree). The client application processes store their coordination data on znodes. These processes can perform all the operations provided in the ZooKeeper client API. Each znode can be accessed through its path in the standard UNIX notation (like having / for the root directory). There is a set of ZooKeeper servers called ZooKeeper Ensemble. All are replicas. One is elected as the leader, while others become the followers.

A high-level design of the ZooKeeper system
A high-level design of the ZooKeeper system

Knowledge test!

  • We have a collection of servers in the ZooKeeper ensemble. What should be the minimum number of servers, and why?

Note: If you need answers to such questions, look at the detailed design of ZooKeeper.

23. Design a scalable distributed storage system like Bigtable#

Problem statement: Design a massively scalable distributed storage system like Bigtable capable of handling petabytes of structured and unstructured data with low latency reads and writes, supporting flexible schema, efficient query patterns, and high availability while ensuring data consistency and durability.

Requirements#

Follow these requirements for the Bigtable system:

Functional requirements

  • Wide applicability
  • High performance
  • User-guided locality
  • Continuous updates
  • Atomic rows

Nonfunctional requirements

  • Durability
  • Availability
  • Scalability
  • High number of read/write operations (throughput)

System Design and workflow#

The following illustration shows that the Bigtable implementation consists of three main parts: a library linked to each client, one Bigtable manager server, and several tablet servers. A library is a component that all clients share. This library enables clients to communicate with Bigtable. The manager server allocates tablets to table servers, identifies tablet server addition and expiration, regulates tablet-server traffic, and garbage collection of files in GFS (a distributed file system). It also supports schema changes like table and column family formation. All tablet servers are in charge of a certain group of tablets, generally around 10 to 1000 tablets. Each tablet server provides reads and writes of the data to the tablets to whom it is allocated. Servers can be added or removed in a Bigtable cluster as needed. New tablets can be made and assigned, old ones can be merged, and they can be reassigned from one server to the other to accommodate changes in demand.

A high-level design of the Bigtable system
A high-level design of the Bigtable system

Knowledge test!

  • How does Bigtable efficiently support schema changes without impacting performance?

  • How does Bigtable ensure data distribution and replication across multiple servers?

Note: If you need answers to such questions, look at the detailed design of BigTable.

24. Design an online multiplayer game system#

Problem statement: Design an online multiplayer game system that allows players to connect and play in real time. The system should handle player matchmaking, maintain low-latency communication, ensure synchronization between players, and consistently manage game state.

Requirements#

Follow these requirements for such a system:

Functional requirements

  • Gameplay (connect and play)
  • Chat service
  • Audio communication
  • Events notification
  • Payment for in-app purchases

Nonfunctional requirements

  • Scalability
  • Availability
  • Security
  • Latency

System Design and workflow#

In an online multiplayer game system, players connect to the game server, which handles matchmaking by pairing players based on skill levels and preferences. Once matched, the server maintains low-latency communication between players, ensuring smooth and real-time interactions using a pub-sub service. The game state, including player positions and actions, is synchronized across all players’ devices through a central game state manager. The session service manages sessions and synchronizes the players. The play service will handle all the game-related tasks like updating stats, checking player’s availability, etc. The payment service facilitates in-app purchases of assets.

For a better user experience, we can separate real-time operations, such as gameplay, from non-real-time operations, such as invites and in-app purchases.

A high-level design of a gaming service
A high-level design of a gaming service

Knowledge test!

  • How can you ensure system stability and prevent crashes when millions of users play simultaneously?

  • How would you implement lag compression and data buffering to handle network delays and ensure smooth gameplay?

  • What are the benefits of using a virtual private cloud (VPC)?

  • How can you maintain low latency for real-time communication, especially during peak usage?

  • How would you limit the number of requests to the server without compromising the real-time gaming experience?

Note: To learn more about the details of gaming service design, explore gaming API design chapter.

25. Design video conference service#

Problem statement: Design a video conference service that allows users to host and join high-quality video meetings with multiple participants. The system should support real-time audio and video communication, manage user interactions and meeting controls, and handle varying network conditions.

Requirements#

Follow these requirements to design the system:

Functional requirements

  • Schedule a meeting
  • Manage participants
  • Stream data (audio and video)
  • Record meeting
  • Real-time communication, like chat

Nonfunctional requirements

  • Scalability
  • Availability and reliability
  • Security
  • Low latency
  • Security for private meetings

System Design and workflow#

All requests in a video conference service pass through a load balancer and API gateway to the backend services. Users can schedule meetings using the scheduling service, which organizes and manages meeting details. When a meeting starts, the media server handles real-time audio and video communication, encoding and decoding media to ensure high-quality streaming. The meeting management service oversees participant roles and permissions, managing who can join or leave the meeting.

The media server with a dedicated screen-sharing module captures and streams the participant’s screen to others for screen sharing. A chat service facilitates real-time text communication among participants and provides chat functionality. To ensure security, the system implements encryption and other measures to protect communication and user data.

A high-level design of a video conference service
A high-level design of a video conference service

Knowledge test!

  • How can you ensure high-quality audio and video streams for all participants, especially when network conditions are unpredictable?

  • What strategies can be used to efficiently handle and scale up to thousands of simultaneous video streams in a single conference?

  • How would you implement real-time user interaction features, such as chat and screen sharing, without impacting the performance of video streaming?

  • What methods can optimize video and audio quality while minimizing latency and buffering?

  • How can you ensure fault tolerance and high availability of the video conference service to avoid disruptions?

Note: Explore the Zoom API design chapter to learn more about designing a video conference service and determine the answers to the above questions.

The final step of your interview prep#

Mastering these 25 questions is a fantastic first step towards comprehensive System Design interview preparation.

However, there are plenty more System Design concepts you'll need to know for a real-world System Design Interview. For more detailed questions and answers – as well as the opportunity to actually get hands-on practice – Educative has created an exhaustive course: Grokking Modern System Design Interview.

This interactive course covers all of the building blocks of modern System Design concept, coupled with more than a dozen real-world questions currently used in the industry. By the end the course, you will understand what clarifying questions to ask and tradeoffs to make for each question. Ultimately, you will learn exactly what it takes to stand out to interviewers in the current hiring market.

That's why if I had to pick just one System Design prep resource to give you, this would be it.

I wish you the best of luck with your interviews. I am confident that with a little hard work and strategic preparation, you will be successful.

Happy learning!

Continue reading about System Design Interviews#

Following are some relevant courses that will help you to further your learning in the System Design and distributed systems domain:

Frequently Asked Questions

What is the purpose of a System Design Interview?

The purpose is to evaluate a candidate’s ability to design scalable, efficient, and maintainable systems. It tests their problem-solving skills, understanding of architecture, and ability to communicate complex ideas.

Is the System Design Interview hard?

What is the role of System Design in software engineering?

Does System Design require coding?

How do I answer System Design Interview questions?

How long are System Design Interviews?

Which companies ask System Design Interview questions?

How to prepare System Design interview questions?

What are some common mistakes to avoid in System Design Interviews?



  

Free Resources