Hey, my fellow reader. Do you know what system design means? Textbook Definition: The process of designing different components, architecture, and interfaces for a system for the end user's requirements is defined as System Design.
Meh. Here is how I would define it:
Before you jump to coding, you must know what you are doing. For that, you need a high-level understanding of how your code will interact with other code (written by other engineers) in the existing system.
To do that, you need to understand three things.
- What do I need to do? (Code that satisfies business requirements)
- How do I do it? (Using existing tooling and infra)
- How does this affect everyone else? (The APIs I expose and the ones I use)
So that's business requirements, engineering standards, and existing tooling. It sounds like designing the flow of your system….voila! System Design.
The best (and worst) part about this is that there is no fixed solution when designing a system. There are design principles and tradeoffs. But a lot of system design depends on the business requirements of your application.
Both Google Maps and Fitness trackers use maps, but they have very different ways of storing and retrieving their map data.
Given this conundrum, how do we approach designing a system?
Ways to approach a Design Problem
-
How to break down the problem?
The first ever step is to break down the problem into smaller components. Need a calling app? A part of this app will handle registration. Another part will handle managing calls. Yet another will handle call logging.
Break. Break. Break. Then Chomp. Chomp. Chomp.
The next step is to ask your interviewer what services and features are needed inside the system. Do you want to allow audio conferencing? Will you be tapping calls of shady folks? How long will you allow calls to last?
Detail the requirements. Then trim them.
-
How to communicate your ideas?
In any interview, saying things out loud helps. It's like a video inside your brain, now being described through your commentary. It helps your interviewer stay in the loop.
Some folks overdo it- they say everything on their mind. This can be exhausting, but more is better than less.
The most important idea though is showing how you plan stuff. Flowcharts and diagrams show how you are thinking visually. It's easy to point out and discuss your ideas when they are visible in front of the interviewer. How do you scale this database? Where can this system fail?
Ideas on paper are worth more than ideas in your head.
What assumptions are fine to make?
-
Is it alright to assume that your users are not aliens? Probably yes.
-
Is it alright to assume that a network call takes 1ns? Probably not.
Give out reasonable numbers while assuming things. These could be well-known facts or statistics you have witnessed at work. Backing your assumptions with solid facts and figures helps ace the interview.
-
The three important things you need to know before designing a system design:
Scalability
When a system increases in size, the complexity of the system increases. The design of a system should be able to cope with this. In an e-commerce platform, an overload during Black Friday is a reasonable thing to expect. The system must be designed to adjust to the increasing needs.
Fault Tolerance
The system needs to keep working despite the faults that occur inside it. That means if a malicious hacker tries to corrupt our system, it repels the attack. If our server farm is raided by the FBI, it re-routes to another server farm. That increases our customers' trust.
Availability
90% of the customers leave a slow-loading webpage. It takes 10 seconds for a recruiter to decide to go deeper into your resume.
We live in a time when customers want things fast. For critical systems like hospitals and banks, availability decides between life and death. Backups, coordination, and fast re-routing are design principles that help keep a system alive.
Conclusion
We got a gist of system design, yes? Your thinking cap is smoking!
It’s time for more exploration! More information on system design, interviews, and related stuff will be shared on our blog page. Also, you have an exclusive system design course available on InterviewReady. Do not forget to check that out, explorers!!
That's it for now!
You can check out more designs on our video course at InterviewReady.