CAP(Consistency-Availability-Partition Tolerance) theorem says that a distributed system cannot guarantee C, A and P simultaneously. It can at max provide any 2 of the 3 guarantees. Let us understand this with the help of a distributed database system.
[PDF] System Design Interview
Load balancing refers to the concept of distributing incoming traffic efficiently across a group of various backend servers. These servers are called server pools. Modern-day websites are designed to serve millions of requests from clients and return the responses in a fast and reliable manner. In order to serve these requests, the addition of more servers is required. In such a scenario, it is essential to distribute request traffic efficiently across each server so that they do not face undue loads. Load balancer acts as a traffic police cop facing the requests and routes them across the available servers in a way that not a single server is overwhelmed which could possibly degrade the application performance.
A system is said to be scalable if there is increased performance is proportional to the resources added. Generally, performance increase in terms of scalability refers to serving more work units. But this can also mean being able to handle larger work units when datasets grow. If there is a performance problem in the application, then the system will be slow only for a single user. But if there is a scalability problem, then the system may be fast for a single user but it can get slow under heavy user load on the application.
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.
Google is one of the most valuable companies in the world and offers a broad spectrum of consumer- and business-centric services. Its phenomenal culture makes it one of the best companies to work for software engineers and developers. As part of its technical interview process, Google conducts a systems design round to evaluate the engineering design skills of applicants. This round mostly happens during the on-site interview, along with the coding and behavioral rounds.
Systems design interviews is an important part of tech interviews at FAANG and tier-1 tech companies. In these interviews, companies evaluate your ability to create scalable systems with low latency, capable of reaching millions of users.
These interviews typically consist of many open-ended interview questions, where you essentially have to discuss the technicalities behind complex, scalable systems. Knowing and applying concepts related to relational databases, sharding techniques, and network protocols is also crucial to ace this round.
The systems design interview rounds aim at testing how you break down a large problem and tackle different parts of it. So while your tech skills are important, your critical thinking is also at display during these rounds. Narrowing down the topics to prepare for such an interview is not easy.
However, based on our experience of training over 9,000 software engineers, the following are some of the key broad categories that you should consider while preparing for a systems design interview:
I've come across the book System Design Interview: an Insider's Guide by accident (paperback book, and online course). I was looking for good book resources after several people have been asking me how they can get better at building distributed systems or learning designing systems at scale. Especially when they don't have the opportunity to do so as part of their day-to-day work.
The topic is somewhat a chicken-and-egg one. You'll know how to design a large system after you designed one before. But if you've not done so: how would you build an URL shortener like bit.ly, with hundreds of millions of links? A chat app like Whatsapp? A file storage system like Dropbox or Google Drive?
There are many resources online - the most well-known one being System Design Primer on GitHub or reading High Scalability articles. In my case, I was looking for a more "structured" approach, as opposed to just dumping a bunch of concepts you need to know in these interviews.
This book is the most "real-world" systems design book I've come across that does a solid effort to teach concepts, step by step, to people who have yet to work at systems at scale. And it's also a welcome refresher to those who are familiar with some of these systems but would like to venture into various other types of large systems. It is clear from the start that the book was written by someone familiar with systems at scale. The author is Alex Xu, a software engineer previously at Oracle, Zynga, and Twitter.
Still, don't forget that this is just a book. Books can help with understanding the theory but are not a replacement actually working on large-scale production systems. These systems are always more complex than any book describes them.
The book lays out time allocation suggestions for an hour-long interview: a few minutes for understanding, 10-15 for the high-level design, 10-25 for the deepdive, and a few more for the wrap-up. I wouldn't be overly prescriptive, but I would suggest to not start the deepdive the first 10 minutes (gather enough context), and leave time for the wrap-up.
One thing you should avoid is "just memorizing" the approaches of the problems. That's far from the point. I made this mistake when I interviewed at Facebook, and was asked to build a part of Instagram. I had done this exercise, and so I just drew out a complicated system. I never talked about constraints or tradeoffs with my interviewer. In fact, I never had a two-way conversation.
A systems design interview is as much about communication with the interviewer as it is about your systems and architecture knowledge. This is why, while the book will help fill gaps you might have on how large systems are built, it won't substitute you collaborating with someone in designing a system.
This book is a solid recommend from me: and not just for preparing for the systems design interview, but to strengthen your systems design muscle for the day-to-day. The book/course comes with typical design problems and brings a pretty good, step-by-step approach to them. But if you just read through them, you'll miss out on the real value of such a resource.
Aim to draw out how you would design the system before reading how the author tackled the problem. You'll go through the book slower: but the concepts will stick. And you'll have approaches to use not just on the interview but when debating with colleagues on how to build a system.
Additionally, the book focuses on backend systems design. Client-side systems design problems for native mobile engineers or web engineers are usually different - I've helped design both these types of interviews. In all fairness, covering those approaches is likely out of scope for this book. Still, for non-backend engineers, the book can be helpful but potentially less applicable.
FundamentalsThis book will equip you with more than 30 technical fundamentals for a system design interview. Instead of giving you definitions that you can easily find online, the book will focus on applying the fundamentals to develop trade-offs and designs for system design questions. Applying fundamentals is how you will do well in a system design interview.
CommunicationCommunication is critical to the success of a system design interview. The book will provide more than 15 communication tactics to impress the interviewer. The design questions will provide you with examples of how you can communicate with the interviewer to develop assumptions, design options, trade-offs, and conclusions.
The system design interview is one of the funnest types of interviews you could get, if you know how to tackle it. The right approach consists of three parts: 1) a playful & collaborative attitude,2) narrowing down the scope through targeted questions, and 3) understanding the main components of any infrastructure, and being able to use them like lego pieces at your disposal. This post will help mostly with this third part. 2ff7e9595c
Comments