If you are a middle or senior-level candidate, you may expect system design questions as part of your technical interview. The objective of system design interviews is to evaluate a candidate's skill at designing real-world software systems involving multiple components.
Understanding and mastering system design questions are crucial in practicing for software engineering interviews. If you’re not properly prepared for these questions and concepts in your interview, you'll miss out on the opportunities of expanding your career with a better-paying position, or even with a great company.
So in this lesson, we will cover how to prepare for a system design interview. You will learn the most common questions and answers.
Most likely, at the beginning of the interview, you will be asked the most basic questions. This way, the recruiter wants to understand if you are familiar with the general principles of system design.
To help you answer questions about fundamentals, let's examine what problems are crucial for most software systems:
Besides basic knowledge about system design, you need to show skills related to this area. These competencies are very revealing to a recruiter. Possessing these three qualities shows that you don't just know the theory, but know how to apply it in the field:
Skill 1. Gathering requirements. The most important part is staying inquisitive and working to understand the demands. To see it more clearly, you can ask to divide the requirements into two sections:
Skill 2. Keeping design documents clear and explicit. The goal is to keep documentation in a way that a person not involved in the conversation can understand. All key points should be written down: your approach, trade-offs, solutions, core flow, and ways to design the system. The key points should be understandable to everyone, and only then can the documentation be considered of high quality.
Skill 3. Converting requirements to implementation. Interviewers want to see how you talk about requirements and internal structures of your systems. They also want to know if you are trying to get to know the user. Ask questions like "who is this feature for?" and "how will they be using it?". This way, you gather more information that will help you translate requirements into implementations.
There may also be questions in the interview about how to scale the system. Scaling the system may be necessary for many reasons, such as increased data volume, increased workload, and a growing audience of users. We have to decide how to scale the system.
There are two types of scaling:
There are things to consider when scaling:
System design interview questions are tough to crack if you aren't well-prepared. The questions are broad, have multiple possible answers, and require some foundational knowledge.
When working on each system design case, you should go through the following steps:
Step 1. Requirements clarifications. Spend a few minutes questioning the interviewer and agreeing on the scope of the system. Make sure you know all the requirements the interviewer didn't tell you about in the beginning.
Step 2. Estimation. It is always a good idea to estimate the scale of the system we’re going to design:
Step 3. API / Interface definition. Define what APIs are expected from the system. This will establish the exact contract expected from the system and ensure that we haven’t gotten any requirements wrong.
Step 4. Data model definition. Defining the data model in the early part of the interview will clarify how data will flow between different system components. Later, it will guide data partitioning and management.
Step 5. High-level design (chart). Sketch the important components and the connections between them, but don't go into some details. Usually, a scalable system includes:
Step 6. Details. For each component, you need to write the specific APIs. You may need to finish the detailed OOD design for a particular function. You may also need to design the database schema for the database.
Step 7. Bottlenecks. Try to discuss as many bottlenecks as possible and different approaches to mitigate them. For example, do we have enough replicas of the data so that we can still serve our users if we lose a few servers? How are we monitoring the performance of our service?
Let's take a look at one common example — let's design a parking lot. This question requires your skills in object-oriented design to check whether you can apply technical thinking to physical objects.
Bottlenecks and expectations:
As you can see from the complex questions above, there is a lot of ground to cover when it comes to system design interview preparation. So it’s best to take a systematic approach to make the most of your practice time.
The Hexlet support team or other students will answer you.
Programming courses for beginners and experienced developers. Start training for free
Our graduates work in companies:
From a novice to a developer. Get a job or your money back!
Sign up or sign in
Ask questions if you want to discuss a theory or an exercise. Hexlet Support Team and experienced community members can help find answers and solve a problem.