Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Design Uber, Ola or Lyft type of systems.

Answer»

These platforms help user request rides and the driver picks them up from the location and drop them at the destination selected by the user.

  • What are some of the required features?
    • Real-time SERVICE for booking rides
    • Should have the capability of assigning rides that lets the user reach the destination fast.
    • Show the ETA (Estimated Time of Arrival) of the driver after booking the ride and once the ride has been started, show the ETA of the vehicle arriving at the destination.
  • What are some of the common problems encountered?
    • How to store geographical locations for drivers always on move?
    • How to assign drivers to the customers efficiently?
    • How do you CALCULATE the ETA of the driver arrival or the destination arrival?
  • Possible tips for consideration:
    • Make use of the microservices concept with fast databases for booking rides faster.
    • Evaluate Dispatch System for assigning drivers to the users.
Conclusion: 

In this article, we have covered the most FREQUENTLY ASKED interview questions on System Design. The key element to clear a System Design interview is that you should have a clear understanding of the APPROACH that you are taking while designing a particular system. For instance, in a system, if you choose to store the data in a No SQL database, you should be clear with the reason that made you choose a No SQL database over a SQL database. You should be clear with the differences between SQL and No SQL databases. In other words, every proposition of yours must be backed by some logical reasoning. This will give you an edge in your interviews.

Useful Resources: 

  • Data Modelling
  • System Design Books
  • Best System Design Courses
  • Software Engineering MCQ
2.

Design ATM system.

Answer»

ATMs are used for depositing and withdrawing money from customers. It is also useful for checking the account balance.

  • What are some of the required features?
    • Each user should have at least one bank account that is linked to the card for PERFORMING transactions.
    • ATM to AUTHENTICATE the user based on 4 digit PIN associated with the card.
    • User to perform only one transaction at a given time.
  • What are some of the common problems encountered?
    • What happens during transaction timeout?
    • What happens if the money is deducted from the bank account but the user hasn't received it from the machine?
  • Possible TIPS for CONSIDERATION:
    • Divide the problem into different entities like Card, Card READER etc and establish a relationship between each of the entities.
3.

Design Web Crawler.

Answer»

The Web crawler is a search engine-related service like Google, DuckDuckGo and is used for indexing website contents over the Internet for making them available for every result.

  • What are some of the Required Features?
    • Design and DEVELOP a Scalable service for collecting INFORMATION from the entire web and fetching millions of web documents.
    • Fresh data has to be fetched for every search query.
  • What are some of the common PROBLEMS encountered?
    • How to HANDLE the updates when users are typing very fast?
    • How to prioritize dynamically changing web pages?
  • Possible tips for consideration:
    • Look into URL Frontier Architecture for implementing this system.
    • Know how crawling is different from scraping.
4.

Design a traffic control system.

Answer»

Generally, in a traffic CONTROL system, we see that the LIGHTS TRANSITION from RED To GREEN, GREEN to ORANGE and then to RED.

  • What are some of the Required Features?
    • Transition traffic lights based on the conventions.
  • What are some of the common problems encountered?
    • Determine the time interval for which the state of the traffic lights has to change.
    • What happens in worst-case scenarios where the state is wrongly shown?
  • POSSIBLE tips for consideration:
    • Make use of state design patterns and scheduling algorithms for the transition of the state from one COLOUR to another.
5.

Design Tic-Tac-Toe game.

Answer»

Tic-tac-toe game involves two players where one player chooses 0 and the other player chooses X for MARKING the cells. The player who fills a row/column/diagonal with their SELECTED character wins.

  • What are some of the Required Features?
    • Support 2 player game where one player can be a computer.
    • Design algorithm to CALCULATE the win and loss results.
  • What are some of the common problems encountered?
    • What happens if both players play optimally?
    • How to decide the winning strategy?
  • Possible TIPS for consideration:
    • If one player is a computer, then make use of the rand() METHOD for ensuring moves are completely random.
6.

Design Netflix.

Answer»

NETFLIX is a video streaming service.

  • What are some of the REQUIRED Features?
    • Uninterrupted video streaming to be made available for the users.
    • Likes and reviews of videos.
    • Recommend NEW videos.
    • Support high traffic of users.
  • What are some of the common problems encountered?
    • Is it acceptable to have lags while uploading videos?
    • What happens if many users are accessing the same video concurrently?
  • Possible tips for consideration:
    • Make use of cloud technology to store and transmit video data
    • There are three components of Netflix: OC (Content Delivery NETWORK), BACKEND database, Client device for accessing the application.
7.

Design a type-ahead search engine service.

Answer»

This service partially completes the search queries by displaying n NUMBER of suggestions for completing the query that the user intended to search.

  • What are some of the Required FEATURES?
    • Service has to match partial queries with popularly searched queries.
    • The SYSTEM has to display n number of suggestions (say 5, for example) based on the written query.
    • The suggestions have to be updated based on the query updation.
  • What are some of the common problems ENCOUNTERED?
    • How to update the suggestions without much latency?
    • How to determine the most likely SUGGESTION?
    • Are the suggestions adapting to the user’s search results?
    • When do the suggestions appear? Is it updated on the fly or once the user stops writing?
  • Possible tips for consideration:
    • Evaluate the usage of natural language processing for anticipating the next characters.
    • Markov chain rule for ranking the probabilities of top queries.
8.

How do you design global file storage and file sharing services like Google Drive, Dropbox etc?

Answer»
  • What are some of the Required Features?
    • Users should be ABLE to upload, DELETE, share and download files over the web.
    • File updates should be synced across multiple devices.
  • What are some of the COMMON problems encountered?
    • Where to store the files?
    • How can you handle updates? Should the files be re-uploaded or does just the modified version has to be updated?
    • How to handle updation of two documents at the same time?
  • Possible tips for consideration:
    • Consider using chunking for SPLITTING files into multiple SECTIONS for supporting re-uploads of a particular section rather than the whole file.
    • Make use of cloud storage for storing the files.
9.

Design an API Rate Limiter system for GitHub or Firebase sites.

Answer»

API Rate Limiters limit the API calls that a service receives in a given time PERIOD for avoiding request overload. This QUESTION can start with the coding algorithm on a single machine to the distributed network.

  • What are some of the Required Features?
    • What is the required request count per hour or second? Let US assume that the requirement can be 10 requests per second.
    • Should the limiter notify the user if the requests are blocked?
    • The limiter should handle traffic suitable according to the scale.
  • What are some of the common PROBLEMS encountered?
    • How to measure the requests per given time?
    • How to design the rate limiter for the distributed systems when compared to a local system?
  • Possible tips for consideration:
    • Evaluate the usage of sliding time windows for avoiding HOURLY resets.
    • Try using a counter integer instead of a request for saving space.
10.

How do you design a recommendation system?

Answer»

RECOMMENDATION systems are used for helping users identify what they want efficiently by assisting them by offering various CHOICES and alternatives based on their history or interests.

  • What are some of the Required FEATURES?
    • Discuss what kind of recommendation system is required - whether it is for movies, e-commerce WEBSITES, songs etc.
  • What are some of the common problems encountered?
    • Figure out how to recommend fresh and relevant CONTENT in real-time.
  • Possible tips for consideration:
    • Discuss how to use the Eval component for understanding the working of the system.
    • Discuss how to train a collaborative filtering approach.
11.

Design Facebook’s newsfeed system.

Answer»

Facebook’s newsfeed allows users to see what is happening in their friend's circle, liked pages and groups followed.

  • What are some of the Required Features?
    • Generate newsfeed USING posts from other system ENTITIES that the user follows.
    • Newsfeed posts can be of text, image, audio or video format.
    • Append new posts to the user’s newsfeed in close to real-time.
  • What are some of the Common Problems encountered?
    • What happens if the new post sees a LOT of latency to get appended to the news feed?
    • Can the algorithm handle sudden user load?
    • What posts should take priority for displaying in the news feed?
  • Possible tips for consideration:
    • EVALUATE the PROCESS of fanout for publishing posts to the followers
    • Check how sharding can be achieved efficiently for handling heavy user load. The feed data of a user shouldn't be put into multiple servers. Instead, sharding can be done on user ids.
12.

Design a forum-like systems like Quora, Reddit or HackerNews.

Answer»

These SITES are meant for posting questions and answering them, showing newsfeed highlighting popular questions based on tags and related topics.

  • What are some of the Required Features?
    • Users should be able to create public posts and apply tags to them.
    • Posts should be sortable based on tags.
    • Post comments in real-time by users.
    • Display posts on newsfeed based on followed tags.
  • What are some of the Common Problems encountered?
    • Should it be just a web APPLICATION?
    • Where to STORE the uploaded images and links?
    • How can you determine the related tags?
    • How can you distribute posts across a server network?
  • Possible tips for consideration:
    • Check on using SQL database for mapping RELATIONAL data between users, posts, comments, likes, tags, posts etc.
    • Incorporate multithreading and load balancer for supporting high traffic.
    • Make use of sharding for distributing the data across different systems.
    • Incorporate machine LEARNING algorithms for finding correlations between the tags.
13.

How do you design a URL shortening service like TinyURL or bit.ly?

Answer»

TinyURL or bit.ly takes a long URL and generates a NEW unique short URL. These SYSTEMS are also capable of taking the shortened URL and returning the original full URL.

  • What are some of the Required Features?
    • Generate a short URL having a LENGTH SHORTER than the original URL.
    • Store the original URL and map it to the shortened one.
    • Allow redirects in the shortened URLs.
    • Support custom names for short URLs.
    • Handle multiple requests at the same time.
  • What are some of the Common Problems encountered?
    • What if two users input the same custom URL?
    • What happens if there are more user load than expected?
    • How do you regulate the database storage space?
  • Possible tips for consideration:
    • The concept of hashing can be used for linking original and new URLs.
    • REST API can be used for balancing high traffic and handling front-end communication.
    • Multithreading concept for handling multiple requests at the same time.
    • NoSQL databases for STORING original URLs.
14.

Design a global chat service like Whatsapp or a facebook messenger.

Answer»
  • What are some of the required features?
    • Allow users to chat over the internet.
    • Provide support for one-on-one and group chats.
    • Messages need to be stored for better viewing.
    • Messages need to be encrypted for SECURITY purposes.
  • What are some of the common problems that can be encountered?
    • What would happen to a message if it is sent without an internet connection?
    • Will encrypting and decrypting increase the latency?
    • How are the messages sent and notified to the device?
  • Possible Tips for CONSIDERATION:
    • Split DATABASE schema into multiple tables such as user table, chat table, massage table etc.
    • Make use of WEB sockets for bi-directional communication between the device and the server.
    • Make use of push notifications for notifying the members even if they are ONLINE.