Large-scale distributed system design has become the standard part of software engineering maintenance. Engineers struggle with system design interviews (SDI) primarily for the following two reasons:
- Lack of experience in developing high-grade systems.
- Unstructured nature of SDI. Even engineers who have some experience building large systems feel uncomfortable with these interviews, mainly due to the open nature of design problems that do not have a standard answer.
A good performance in SDI is very rewarding because it reflects your ability to work with complex systems and translates into the position and compensation (salary and shares) that the interview the company will offer you.
Check out the following resources to prepare for software engineering interviews:
At Educative.io, we discuss it with hundreds of applicants who have gone through design interviews. As part of this procedure, we have compiled a list of the most frequently asked systems design interview questions.
These are the most frequently asked questions, as well as some suggestions on things the researchers want you to consider when designing the system.
Given a (usually) long URL, how do I design a service that generates a shorter and unique alias for it.
Discuss things like:
- Comment gto generate a unique identifier for each URL?
- How would you generate unique identifiers on a large scale (thousands of URL shortening requests arrive every second)?
- How will your service handle redirects?
- How would you accept custom short URLs?
- How to remove expired URLs etc.
- How to track click statistics?
Videos mean that your service will store and transmit petabytes and petabytes of data. You must analyze how to store and distribute data efficiently so that a large number of users can see and share it simultaneously (for example, imagine the transmission of the last episode of a successful television show like Games of Thrones).
- How would you record the statistics of the videos, for example, total number of views, positive / negative votes, etc.
- How could a user add comments to the videos (in real time)?
Researchers want to know:
- How would you view individual conversations between users?
- How would you expand your layout to support group chats?
- What to do when the user is not connected to the Internet?
- When to send push notifications?
- Can you provide end-to-end encryption?
Users of the service can post questions or share links. Other users can answer questions or comment on shared links. The service must be able to:
Record statistics for each answer, for example. the total number of views, positive / negative votes, etc.
Users must be able to follow other users or topics.
Your timeline will include the top questions from all users and the topics they are following (similar to generating news).
Discuss things like:
- How can users download / view / search / share files or photos?
- How would I keep track of file sharing permissions?
- How would I allow multiple users to edit the same document?
When designing a social networking service with hundreds of millions (or billions of users), researchers want to know how to design them. Following the components
- Efficient stockage and search for messages or tweets.
- Generation of news in real time
- Social graph (who befriends whom or who follows whom, especially when millions of users follow a celebrity)
Often times, interviewers spend the entire interview discussing the layout of the news.
When designing a rideshare service, consider topics such as:
- Most critical use case: when a customer requests a ride and how to combine it effectively with nearby drivers?
- How to store millions of geographic locations for drivers and drivers in motion.
- How to manage driver location updates (millions of updates per second)?
For Type-Ahead, as the user types their request, they should design a service that suggests the top 10 search terms starting with what they wrote. Analyze things like:
- How to store previous search queries?
- How to keep the data updated?
- How to find the best matches with the string already entered?
- How to deal with updates and user typing too fast?
For Web Crawler, we need to design a scalable service that can crawl the entire Web and retrieve hundreds of millions of Web documents. Discuss things like:
- How do I find new web pages?
- How to prioritize dynamically changing web pages?
- How to make sure your tracker doesn’t get stuck indefinitely on the same domain?
You are expected to develop speed limiting services that can:
- Limit the number of requests that an entity can send to an API in a time window, for example, 1 5 requests per second.
- The speed limiting should work for a distributed configuration, as the APIs are accessed through a group of servers.
- How would you handle the limitation (soft and tight regulation, etc.)?
This service would need to store locations for millions of people / places. Discuss topics such as:
- How can users of the service find friends or nearby places?
- How to classify places (according to distance, user opinions).
- How to efficiently store location data according to population density (for example, a block in New York may have more places / people than a small city).