đ˛ How to prepare the system design interview
A step-by-step framework to solve this interview + đ Free Notion Template
Entry-level roles donât have this interview and your knowledge from your time as a student is not relevant or itâs forgotten. Most people are afraid of it because they are self-taught in System Design.
Welcome to the guide all software engineers need to ace the system design interview at FAANG companies.
This is the last post in my 4 post series Iâm writing about the technical interview for software engineers.
đşď¸ How to prepare the technical interview (Contains an explanation of my study framework)
đ˛ How to prepare the system design interview. (this post).
đ The preparation framework
This is the planning to do before grinding problems.
1) Understand the mindset of this interview
When we talk about âDesigning Youtubeâ, you wonât design it with all its complexity.
I can tell you from working on Amazonâs Search page. Thereâs no way you define a system at this scale in your 1-hour interview.
The goal of the interview is to show you understand common patterns in real-world applications.
2) Identify patterns
Because a 1-hour interview is not enough to get into details of a particular platform, even when using the name of a platform as the title, the problem youâll solve is a generic pattern.
As an example, designing the home page of YouTube (with all video miniatures) is the same kind of problem as designing a Twitter feed, Instagram feed, or TikTok feed. Itâs a âsocial media feedâ problem.
Another group could be designing Glovo, designing Uber, designing Google Maps⌠They are âSpatial dataâ problems.
When finding resources and solutions, donât get frustrated because you donât find anyone solving âDesign Instagram Storiesâ, because itâs the same problem conceptually as âDesign Snapchatâ.
Check the đ Notion template for a list of problems with their groups. Itâs interesting to think about the problems separately because each app you design has its particularities.
3) Identify your gaps
You may have worked all your life with regular 3-tier web applications with a frontend app, the backend API, and the Database.
If I ask you: âDesign the upload workflow for Youtubeâ or âDesign Twitchâ, youâll be blocked. You never worked with video processing.
Now is when you want to go through the groups of problems and identify what you donât have any idea about.
For me most of these were completely unknown and I had to study them from scratch. Thatâs fine. You donât need to become a master of all, you need to understand what elements come into play
4) Collect resources for study and practice
In the example above, if you have a gap in video processing, Iâd still not recommend you to study in-depth video processing workflows.
The goal of the interview is not to show you are an expert in an area unless the position you interview for is about it. Focus on the breadth of these patterns of problems rather than depth.
From the resources in this post, pick the resources for theory and practice that you need the most.
đşď¸ The interview framework
This is heavily based on the framework proposed by Alex Hu in his books on System Design.
1) Ask clarifying questions and gather all requirements
You are told the problem and itâs intentionally vague. Interviewers do this to get you talking.
Focus on writing down the functional and non-functional requirements.
Functional requirements:Â If your problem is âDesign X productâ, interpret it as defining its core functionality. Clarify with the interviewer if thatâs the scope you want to cover. Examples:
Design Instagram/Twitter â Design the upload workflow and the feed. Assume reverse chronological order
Design YouTube â Design the upload (video processing) and consumption of a video. Notice how even if YouTube has a feed, itâs likely they donât want the feed if they ask for YouTube.
Define the use cases and API design.
Depending on the problem, youâll have a clear API that youâll have to define (REST, RPC, GraphQLâŚ). Other problems will not require a definition of an API but rather have the use cases âwe have a read use case and a write use caseâ.
Define the nonfunctional requirements.
These problems are oriented to âwe have to scale this to N thousand of customers and expert viral growthâ.
Despite that, not all architectural characteristics are relevant to each problem. You have to understand the domain of the problem.
For a social media feed, eventual consistency is fine. Itâs fine you wonât get a post until propagated to all DBs. Itâs even fine losing a post. You prioritize high scalability and low latency.
For a money transaction, you canât have eventual consistency. Thereâs no reconciliation possible if an account balance gets to $-1000. Also, the transactions are less frequent than people refreshing a social media feed. You prioritize data durability and consistency instead of latency/throughput
If you donât understand the product you are asked to design, ask questions to the interviewer as a user of the platform and try to compare it with other products you know: âIs this a social media feed like Instagram?â, âWhat kind of content can people upload to this social media?â
To understand the problem, ask yourself questions like:
Read vs Write traffic?
Size limit on files?
Encryption requirements at rest and in transit?
2) Propose a high-level design. Validate it.
The typical design of a web application contains a generic design where you name the DNS, frontend servers behind a LoadBalancer, backend servers behind a LoadBalancer, a distributed database (either SQL or NoSQL)
But thatâs just memorizing and not solving the problem at hand. Create a mental checklist you go through for every problem:
Is this workflow fully synchronous or anything asynchronous with workers?
Whatâs the protocol for communication between clients and servers? regular HTTP, HTTP LongPolling, WebSockets, UDP based protocolsâŚ
What kind of storage do you need?
Do you benefit from caching some data?
3) Get into the details
Ask the interviewer what to dive deeper into.
Some scenarios to dive deep into could be:
How the database is partitioned and replicated
Walk through the entire request from the DNS up to your services.
Data modeling
You wonât have time to go into the low level for each area. Get the information from the interviewer.
4) Walk through the use cases and answer any follow-up question
Now itâs turn to go back to the functional requirements and walk through how your system solves them.
Youâll often find edge cases you didnât consider.
âď¸Preparation resources
đ§âđDeliberate study time
Thereâs no point in preparing for the system design interview without having a solid base on distributed systems.
Since most of this is not studied at universities and many people donât have this exposure to large-scale systems at their day jobs, I consider the study time the most important part of this preparation.
My recommendations:
đ§âđDeliberate practice time
Donât think just studying youâll crack the interview. You need to practice in an interview-like scenario.
Use the Interview Framework in your practice problems. Once you get stuck, leave TODOs across your design and check the answer later in a solved problem.
You may want to use mock interview platforms to practice. I have never used any and always practiced self-taught
Remember, try to solve them first, and check how other people solve them later.
đ System Design Interview book 1 and book 2 by ByteByteGo
đ Grokking System Design course 1 and course 2 in Educative.io (I didnât use this, but heard good recommendations)
Find the solved problems across the internet
đĄď¸Siege your brain time
No engineer has worked at all the big tech companies solving all the groups of problems. We all have areas we donât know from first-hand expertise.
These resources are great for reducing your gaps:
Read newsletters:
đ°
đ°
đ°
đ°
Read GitHub READMEs
đ ByteByteGo
đ SystemDesign
đ Frontend-oriented
Watch YouTube solved problems
đĽÂ Exponent
đĽÂ Gaurav Sen
đĽÂ ByteByteGo
đĽÂ System Design Fight Club
đąÂ Other advice
đ Use ChatGPT and ChatGPT-powered resources.
There are many things in the system design interview related to the theory of distributed systems. Itâs great to check out with an LLM to dive deeper and understand why using one approach or another.
I used ChatGPT to refine my understanding of event-emitting and event-processing with streaming technologies. It was like having a Senior engineer answering my doubts based on my level of understanding of the technologies.
There are also integrated platforms like Codemia where you have the LLM implicit by default. Itâll reduce the prompt engineering pre-work you have to do.
đ¤ˇââď¸Â Donât worry if you solved the problem based on other requirements
A common concern I had is that I imagined I had to do some calculations for 1k read transactions per second (TPS) and another person would solve the problem for 50k read TPS.
Both are fine if you have the right reasoning. Donât bother about solving with the same numbers as someone else but about your calculations and intermediate steps being right.
â Focus on communicating the entire interview
Remember the goal of the interview is not creating a real product from your design, but checking how you think and reason about systems.
Communicate during the entire interview and treat the interviewer as a coworker you are doing a whiteboarding session with.
đď¸ Resources
đ System Design Interview book 1 and book 2 by ByteByteGo
đ Grokking System Design course 1 and course 2 in Educative.io (I didnât use this, but heard good recommendations)
đ TianPan.co
đ°
đ ByteByteGo
đ SystemDesign
đ Frontend-oriented
đĽÂ Exponent
đĽÂ Gaurav Sen
đĽÂ ByteByteGo
đĽÂ System Design Fight Club
đ Weekly applause
I have been doing my annual review this week and I found these posts insightful:
How to Conduct Your Own Annual Review - Chris Guillebeau â I was doing my annual review this week. I apply many of these topics like a yearly theme and setting up milestones per area.
Reduce the gap between idea and execution -
â When planning the goals for my yearly review, I find it valuable to set micro-goals based on input rather than SMART goals based on results.The Personal Annual Review - Sahil Bloom â The most important part of an annual review is having the right prompts to answer with useful information. This article contains quite a few good prompts.
Why asking your customers what they want doesn't work -
â We canât predict HOW weâll solve a problem in the next 365 days. This leads to goals that have to be thrown away in the middle of the year. We have to ask ourselves what job an activity does and focus on improving and fulfilling that goal. Sometimes that means throwing away your current activity.
I like this guide. Especially asking questions and making sure you have the full picture of requirements and limits before jumping into solutions.
Thanks, Fran!
A great overview of design interviews. A very important part is my opinion is to make clear during the interview which problems you DONâT solve with your solution, and not assume you chose the top priority ones.
Itâll give the interviewers a chance to nudge you in another direction before you dig a deep hole