The main focus in this round is to see your thought process and whether you'll be able to design a minimal system keeping future scale in mind and by following the standard principles.
How should one approach System Design questions during an interview?
Here's the step by step guide:
🧵👇🏻
The main focus in this round is to see your thought process and whether you'll be able to design a minimal system keeping future scale in mind and by following the standard principles.
You cannot possibly design a complex system in 1-2 hours which engineers usually take months to years to design, develop and build.
So this is how you should approach this round:
Example: "Design an application like Twitter"
- Post tweet
- Home timeline
- Profile timeline
- Analytics
- Likes
- Retweets
- Following
- Bookmark
- Trending etc
You get the idea!
Ask a lot of specific questions in this step and make sure both of you are on the same page.
- consistency
- availability
- durability
- scalability etc
In this step you can assume the traffic your service gets and estimate how much data you need to store in your tables so that your system works for the next 5 - 10 years without running into any problems.
- Read / Write ratio (ex: Twitter)
- Each file size (ex: Dropbox)
- Average photo size (ex: Instagram)
- Total active users (Ex: Facebook) etc
Based on the assumptions, you can calculate how much data you need to store in your tables.
Ex: In case of Twitter:
- Clients
- Timeline Svc
- Search Svc
- DB Storage
- Cache
etc
Come up with different tables, their schema and relations between them to store the data for your application.
Based on the columns and the data type of each of the column you can compute how much data you may need to store for the next 5-10 years.
For example if your data schema constantly changes and scalability is a requirement, you can go with a NoSQL db.
If transactions are important then go with SQL.
For example:
- in case of URL Shortener service they may ask you how you would generate the shortened url for every given long url.
In this case you may want to precompute the timeline for users because of the huge data volume and the realtime behaviour we need.
Since this is a spatial search problem, you may want to store the data in a quad tree.
Depending on the requirements, discuss about how you would do partitioning & sharding.
Cache allows you to store the frequently used data and access it much faster which improves the overall response time of your APIs.
In this case you may want to cache that 20% of the data. You can estimate how much cache storage is needed based on each entity data size and your total traffic.
Note that the interviewer may ask you to discuss all of the above step by step at high level as discussed or any one in detail.
More from Sunil Kumar
Are you a web developer or a designer?
These websites will help you create professional mockups for your applications:
🧵👇🏻
1. Shot Snap:
Create beautiful device mockup images for your app or website
2. Smart Mockups:
Create stunning product mockups (free & premium)
https://t.co/1RmIQhAreS
3. Screely:
Instantly turn your screenshot into a mockup
https://t.co/riAzf7CioH
4. Screenshot .rocks:
Create beautiful browser & mobile mockups in seconds.
https://t.co/EpxLukHg8T
These websites will help you create professional mockups for your applications:
🧵👇🏻
1. Shot Snap:
Create beautiful device mockup images for your app or website
2. Smart Mockups:
Create stunning product mockups (free & premium)
https://t.co/1RmIQhAreS
3. Screely:
Instantly turn your screenshot into a mockup
https://t.co/riAzf7CioH
4. Screenshot .rocks:
Create beautiful browser & mobile mockups in seconds.
https://t.co/EpxLukHg8T
More from Software
The Great Software Stagnation is real, but we have to understand it to fight it. The CAUSE of the TGSS is not "teh interwebs". The cause is the "direct manipulation" paradigm : the "worst idea in computer science" \1
Progress in CS comes from discovering ever more abstract and expressive languages to tell the computer to do something. But replacing "tell the computer to do something in language" with "do it yourself using these gestures" halts that progress. \2
Stagnation started in the 1970s after the first GUIs were invented. Every genre of software that gives users a "friendly" GUI interface, effectively freezes progress at that level of abstraction / expressivity. Because we can never abandon old direct manipulation metaphors \3
The 1990s were simply the point when most people in the world finally got access to a personal computer with a GUI. So that's where we see most of the ideas frozen. \4
It's no surprise that the improvements @jonathoda cites, that are still taking place are improvements in textual representation : \5
The Great Software\xa0Stagnation https://t.co/A6peSPERaU
— Jonathan Edwards (@jonathoda) January 1, 2021
Progress in CS comes from discovering ever more abstract and expressive languages to tell the computer to do something. But replacing "tell the computer to do something in language" with "do it yourself using these gestures" halts that progress. \2
Stagnation started in the 1970s after the first GUIs were invented. Every genre of software that gives users a "friendly" GUI interface, effectively freezes progress at that level of abstraction / expressivity. Because we can never abandon old direct manipulation metaphors \3
The 1990s were simply the point when most people in the world finally got access to a personal computer with a GUI. So that's where we see most of the ideas frozen. \4
It's no surprise that the improvements @jonathoda cites, that are still taking place are improvements in textual representation : \5