High-Level Design Interview – How to Approach It And Ace It

If you are in the software industry, you have heard about High-Level Design or HLD. To learn about the counterpart of high level design, please visit the article Low-Level Design Interview – How to Approach It And Crack It. If you are a fresher, the first question that might come to your mind is what exactly is High-Level Design? Or if you are an experienced professional and you already know what it is, the question that might be coming to your mind is how to crack the interview or how to ace it. If you are thinking of these questions, you have come to the right place.

What is a High-Level Design?

High-level design(HLD) is a type of system design where you have to draw the building blocks of the entire system. It might include:

  • What type of servers you are going to use?
  • What type of queues you’ll use in your system?
  • How these different servers and systems will communicate with each other?
  • What type of database technologies you will use in your system? Will it be SQL or NoSQL?
  • If you’ll be using caching in your design? If yes, what type of cache?

Among other things. But you get the idea, right?

Below is a rough idea of what a High-Level Design might look like. It will not be the same, but the basic building blocks would be somewhat similar.

High-Level Design

Now that we have some understanding of what high-level design is, let’s take a deep dive into what you need to do to ace this interview.


Also check: How to Prepare for and Crack the Coding Interview


How To Crack High-Level Design(HLD) Interview?

Let’s take a look at what needs to be done to crack the high-level design interview. There is no single mantra to this. So you need to be thorough in your preparation.

Start With the Basics of High-Level Design

Design Interview

For acing the high-level design interview, you need to have strong fundamentals. Or if your fundamentals are already strong, you need to brush it up as much as possible. Now what do we mean by basics in the context of a high-level design interview? There are some concepts and terminologies you need to understand. Let’s find out what these are.

Scaling

Scaling is the ability of a system to grow to handle increased loads. There are three types of scaling in general:

Vertical Scaling – Also known as scaling up, it is achieved by increasing the capacity of existing systems/ machines to handle the extra load. This is done by increasing RAM and/or processing power.

Horizontal Scaling – Also known as scaling out, it is achieved by adding more systems/ machines to handle the extra load.

Hybrid Scaling – This involves a combination of vertical and horizontal scaling. In this, we add more systems but the systems we are adding are bigger/ better than existing systems.

Load Balancing

When the traffic on a website/ system increases, we need to add more systems to cater to the increased demand. Load Balancing is the approach using which we can make sure all systems are being used to serve the traffic. Load Balancers are used for the same. It can be hardware/ software or both.

Consistent Hashing

Consistent Hashing is a distributed hashing technique used to do load balancing. It operates independently of the number of servers or objects. This is achieved by assigning them a position on a circle. This allows us to add servers/ systems without affecting the overall system logic.

Message Queues

Message queues are systems that are used to communicate between systems asynchronously. A system can send a message to another system without waiting for a reply. Message queues are used for this.

Microservice & Monolithic Architecture

A system is said to be confirming to microservice architecture if it is divided into smaller, independent components interacting to achieve a common goal. Since the code/ logic is in different systems, communication between the systems happens via APIs.

A monolithic system is one in which all the code/ logic resides in a single system or computer. The communication between different components happens in memory.

Database Sharding

Database Sharding is the process of dividing a large database into smaller manageable components. An example can be to split the data across systems based on username. So names starting with A reside on server 1, starting with B on server 2, and so on.

SQL & NoSQL

SQL(Structured Query Language) is better suited for systems with a fixed schema. Whereas NoSQL(No Structured Query Language) is suited for systems with no fixed schema.

CDNs

CDN(Content Delivery Network) is a caching technique that is used to store data near the destination. Destination in this case means where it will be consumed. By doing this, we are reducing the load on servers and also ensuring the content reaches the users faster.


Also check: Machine Coding Round – What is it & how to crack it


Approach to be Used in High-Level Design(HLD) Interview

Since High-Level Design rounds usually last about 1 hour, I have divided it into a few steps along with time estimates for every step as this will help you in planning your time accordingly.

Functional & Non-Functional Requirements (3-5 mins)

The first step involved in a high-level design interview is to understand the requirements first. Try to spend a few minutes to understand the requirements. Ask a few questions during the interview to make sure you understand the requirements fully. Don’t dive into the solution directly. Functional requirements depend on what we are trying to implement whereas non-functional requirements are fairly standard such as availability, scalability, fault tolerance, reliability, etc.

Estimation(5-7 mins)

The next step is estimation. This includes any type of estimation that will be needed as part of the design. These may include traffic estimates, bandwidth estimates, storage estimates, number of users, among other things.

APIs(3-5 mins)

This will include all the APIs that will be included as part of the high-level design. These would be generally GET, PUT, POST, and DELETE APIs that would be used for the persistence of data. It’s a good idea to list these down so you know what operations you’ll be performing.

SQL/ NoSQL Schema(5-7 mins)

Next would be a decision-making step. You need to decide if you will be using SQL or NoSQL or a mix of both for your system. You would also need to justify why you are choosing either of the solutions. There would be systems where SQL would serve better and systems where NoSQL would serve better. You would also need to define the tables, columns, views, etc. that would be used to organize your data in the database.

High Level Design(3-5 mins)

Now comes the fun part. You would need to design a high-level design of the system you are proposing. It should define the components at a high level. This step and the next step are the core of this interview. Below is a very simple example of high-level design. Remember this is just a high-level design, the detailed design will be in the next step.

High Level Design

Component Diagram(20-25 mins)

Now that we have designed the system at a high level, it’s time to take a deep dive and design the system at the component level. This type of diagram might include components like microservices, databases, file storage systems, load balancers, caches, etc. Below is a rough idea of how a detailed component diagram should look like. This explains a car booking system like Ola, Uber, etc.

Component Diagram Of Car Booking System

Trade-offs and Alternative Solutions(5-7 mins)

The last step involves explaining the trade-offs that were considered as part of the current high-level design and the potential alternate solutions that might exist. It’s possible that the current system is not the most optimal and there exists a better solution. You can take this time to explain these things verbally. The interviewer might also have some questions about the design or they can propose alternate solutions. You can discuss these at this point of time.

Examples of High-Level Design Problems & Solutions

By now, you might have got a fair understanding of what high-level design(HLD) is and what you need to do to crack it.

All the best!!!

To keep up with our latest content, please subscribe to our newsletter by dropping your email address here: Signup for Our Newsletter.

Please follow us on Medium.

Further Reading

One Reply to “High-Level Design Interview – How to Approach It And Ace It”

Leave a Reply

Your email address will not be published. Required fields are marked *