How to Approach System Design Questions during Interview?

System design questions is likely to be asked in the final technical round of a tech interview of top companies like Amazon, Microsoft, Google, Uber, and other large-scale tech start-ups. Such a type of interview is an open-ended conversation, where as a candidate, we are expected to lead it along with a discussion with the interviewer. 

In this blog, we will discuss some steps to solve system design problems during an interview.

Steps to approach a System Design Interview

Step 1: Requirements clarifications

It’s always a good idea to ask about the scope of the problem we’re trying to solve. Since system design questions are often open-ended and don’t have a single correct answer, so it’s essential to clarify any ambiguities early in the interview.

Candidates who take the time to describe the system’s end goals have a higher chance of succeeding in the interview. So we need to gather requirements, understand the scope of the problem and ask questions to clarify assumptions, use cases and constraints with the interviewer.

  • Who is going to use it?
  • How are they going to use it?
  • How many users are there?
  • What does the system do?
  • What are the inputs and outputs of the system?
  • How much data do we expect to handle?
  • How many requests per second do we expect?
  • What is the expected read-to-write ratio?

Step 2: Back-of-the-envelope estimation

While designing the system which works on scale, we need to start somewhere. This is why we first need to define the system's scale. We should consider the read-to-write ratio, the number of concurrent requests the system should expect, and various data limitations. Once we discuss and define these parameters with the interviewer, we can think of the best way to design a system that works well on scale.

Step 3: Database Design

how to approach system design Interview image 1

Before we design a hypothetical system, we need to define how we will process data. Find out the inputs and outputs, how they will be stored, and how the data will flow. If we know what database would serve the purpose better, it will be enough. Remember, we don’t need to go into detail too much at this stage.

Step 4: Create a high-level design

We need to outline a high-level design with all critical components and try to draw a diagram representing the system's core components. We should identify enough components that are needed to solve the actual problem from end to end.

Step 5: Design core components

Discuss in deep the major components; the interviewer’s input can often guide us to the system's parts that need more attention. We should present various approaches, benefits, and drawbacks and justify why we choose one.

Dive into details for each core component. For example, if we were asked to Design a Tiny-URL, discuss:

Generating and storing a hash of the full URL

  • MD5 and Base62
  • Hash collisions
  • SQL or NoSQL
  • Database schema

Translating a hashed URL to the full URL

  • Database lookup
  • API and object-oriented design

Step 6: Scale the design

Based on the constraints, we need to identify and address bottlenecks. For example, do we need the following to address scalability issues?

  • Load balancing
  • Horizontal scaling
  • Caching
  • Database sharding

Step 7: Identifying and resolving bottlenecks

how to approach system design Interview image 2

We should try to discuss as many bottlenecks as possible and different approaches to mitigate them.

  • Is there any single point of failure in our system? What are we doing to mitigate it?
  • Do we’ve enough replicas of the data so that we can still serve our users if we lose a few servers?
  • Similarly, do we’ve enough copies of different services running such that a few failures will not cause a total system shutdown?
  • How are we monitoring the performance of our service? Do we get alerts whenever critical components fail or their performance degrades?

System design questions to explore and practice the flow

Enjoy learning, Enjoy system design!

Share feedback with us

More blogs to explore

Our weekly newsletter

Subscribe to get weekly content on data structure and algorithms, machine learning, system design and oops.

© 2022 Code Algorithms Pvt. Ltd.

All rights reserved.