• Stars
    star
    4,843
  • Rank 8,683 (Top 0.2 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Systems design is the process of defining the architecture, modules, interfaces, and data for a system to satisfy specified requirements. Systems design could be seen as the application of systems theory to product development.

Grokking System Design Interview

Source: educative

Interview Process

  • Scope the problem
    • Don’t make assumptions.
    • Ask clarifying questions to understand the constraints and use cases.
    • Steps
      • Requirements clarifications
      • System interface definition
  • Sketch up an abstract design
    • Building blocks of the system
    • Relationships between them
    • Steps
      • Back-of-the-envelope estimation
      • Defining data model
      • High-level design
  • Identify and address the bottlenecks
    • Use the fundamental principles of scalable system design
    • Steps
      • Detailed design
      • Identifying and resolving bottlenecks

Distributed System Design Basics

System Designs

System Design Interviews: A step by step guide



SYSTEM DESIGN PREPARATION

  • How to prepare for and answer system design questions

Objective

Learning about and implementing large-scale distributed system is not easy. I do not want to give the impression that it's something that can be learnt in a month. What this repository aims to achieve, is for software engineers and students to get a rough idea of how the thought process of designing a large scale works and how big companies have managed to solve really hard problems. Along with that, there is a recent trend for companies to have an open-ended interview with system design questions, which is at times hard for engineers of all levels if they haven't gotten the opportunity to work on such systems themselves.

This is a collection of links/documents for the following use cases: a) Prepare for a system design or open-ended rounds. b) Learn more about how large-scale systems work and thought process of designing a new system.

Index

Starting point

For a very broad overview please go through these lectures, really useful:

These talks should give you a starting point on how to think about such problems.

Basics

But before you begin, here are some topics(in no particular order) which in my opinion you should have a decent idea of before proceeding.

  1. Operating system basics: how a file system, virtual memory, paging, instruction execution cycle etc work (For starters silbershatz should be enough. If you already have decent knowledge try stallings book on OS)
  2. Networking basics: Should know the TCP/IP stack, basics of how Internet, HTTP, TCP/IP work at the minimum. cs75 on youtube (1st lecture) should give a broad overview. I personally love networking-a top down approach.
  3. Concurrency basics: threads, processes, threading in the language you know. Locks , mutex etc.
  4. DB basics: types of DB's (SQL vs noSQL etc ), hashing and indexing, EAV based databases, Sharding, caching for databases, master-slave etc
  5. A basic idea of how a basic web architecture is: say load balancers, proxy, servers, Database servers, caching servers, precompute, logging big data etc. Just know broadly what is each layer for.
  6. very basic summary of what the CAP theorem is (Have never been asked about the theorem itself, but knowing it will help you in designing large-scale systems.

How to answer in interviews

  • I found hiredintech videos an excellent place to start with. The way how to approach a design question as given in the link is really useful. It goes into how we start with clearing the use-cases of the system, then thinking in the abstract manner of the various component and the interactions. Think about the bottlenecks of the system and what is more critical for your system (eg latency vs reliability vs uptime etc) Address those giving the tradeoff of your approach.

  • system design in crack the coding interview: good approach on how to begin attacking a problem by first solving for a small usecase then expanding the system.

  • The best way to prepare for such questions is do mock interviews, pick any topic (given below) try to come up with a design and then go and see how and why it is designed in that manner. There is absolutely no alternative to practice!! Whiteboarding a system design question is similar to actually writing code and testing it! Just reading will only take you so far.

Steps how I approach the system design questions in interviews

These are the steps I go through mentally in the interviews, followed by actual interview experiences:

  • a) Be absolutely sure you understand the problem being asked, clarify on the onset rather than assuming anything
  • b) Use-cases. This is critical, you MUST know what is the system going to be used for, what is the scale it is going to be used for. Also, constraints like requests per second, requests types, data written per second, data read per second.
  • c) Solve the problem for a very small set, say, 100 users. This will broadly help you figure out the data structures, components, abstract design of the overall model.
  • d) Write down the various components figured out so far and how will they interact with each other.
  • e) As a rule of thumb remember at least these :
    1. processing and servers
    1. storage
    1. caching
    1. concurrency and communication
    1. security
    1. load balancing and proxy
    1. CDN
    1. Monetization: if relevant, how will you monetize? eg. What kind of DB (Is Postgres enough, if not why?), do you need caching and how much, is security a prime concern?
  • f) Special cases for the question asked. Say designing a system for storing thumbnails, will a file system be enough? What if you have to scale for facebook or google? Will a nosql based database work?
  • g) After I have my components in place, what I generally try to do is look for minor optimization in various places according to the use-cases, various tradeoffs that will help in better scaling in 99% cases.
  • h) [Scaling out or up] (http://highscalability.com/blog/2014/5/12/4-architecture-issues-when-scaling-web-applications-bottlene.html)
  • i) Check with the interviewer is there any other special case he is looking to solve? Also, it really helps if you know about the company you are interviewing with, what its architecture is, what will the interviewer have more interest in based on the company and what he works on?

Common Design questions

It generally depends what you are and you will be working on. Also what your level is but these are some of the more frequent interview questions.

  • Design amazon's frequently viewed product page (eg. which shows the last 5 items you saw)
  • Design an online poker game for multiplayer. Solve for persistence, concurrency, scale. Draw the ER diagram for this
  • Design a [url compression system] (http://www.hiredintech.com/system-design/the-system-design-process/)
  • Search engine (generally asked with people who have some domain knowledge): basic crawling, collection, hashing etc. Depends on your expertise on this topic
  • Design dropbox's architecture. good talk on this
  • Design a picture sharing website. How will you store thumbnails, photos? Usage of CDNS? caching at various layers etc.
    • Design a news feed (eg. Facebook , Twitter): news feed
  • Design a product based on maps, eg hotel / ATM finder given a location.
  • Design malloc, free and garbage collection system. What data structures to use? decorator pattern over malloc etc.
  • Design a site like junglee.com i.e price comparision, availability on e-commerce websites. When and will you cache, how much to query, how to crawl efficiently over e-commerce sites, sharding of databases, basic database design
  • A web application for instant messaging, eg whatsapp, facebook chat. Issues of each, scaling problems, status and availability notification etc.
  • Design a system for collaborating over a document simultaneously (eg google docs)
  • (very common:) top 'n' or most frequent items of a running stream of data
  • Design election commission architecture : Let's say we work with the Election Commission. On Counting day, we want to collate the votes received at the lakhs of voting booths all over the country. Each booth has a voting machine, which, when connected to the network, returns an array of the form {[party_id, num_votes],[party_id_2, num_votes_2],...}. We want to collect these and get the current scores in real time. The report we need continuously is how many seats is each party leading in. Please design a system for this.
  • Design a logging system (For web applications, it is common to have a large number of servers running the same application, with a load balancer in front to distribute the incoming requests. In this scenario, we want to check and alarm in case an exception is thrown in any of the servers. We want a system that checks for the appearance of specific words, "Exception", "Disk Full" etc. in the logs of any of the servers. How would you design this system?)

Architectures :

Personally I looked into the following architectures:

Company engineering blog links

courtesy checkcheckzz

Depending on where you are interviewing, go through the company blog. VERY USEFUL IN INTERVIEWS! It really helps if you have an idea of the architecture, as the questions asked will generally be of that domain and your prior knowledge will help out here.

Low on time ?

I would HIGHLY recommend you do not take a shortcut unless you have a week or so for an interview. System design is best learnt by practising, shortcuts might help you in the short term, but would recommend coming back to this link for an in-depth understanding after the interview

  • a) Go through cs76 and Udacity's links given above for scaling systems.
  • b) Go through the engineering blog of the company you are interviewing in (or if its a startup go through the link of the company closest to yours)
  • c) See this talk: http://www.hiredintech.com/system-design/the-system-design-process/ and develop a process for how to answer such questions.
  • d) Remember these terms, just roll over them in your interview in your mind, and if relevant mention it in the interview
  1. processing and servers
  2. storage
  3. caching
  4. concurrency and communication
  5. security
  6. load balancing and proxy
  7. CDN
  8. Monetization

Best of luck 👍, feel free to send pull requests to add more content to this git!

More Repositories

1

LeetCode-Course

This is a course designed to ramp up an individual ASAP to crush tech interviews.
11
star
2

Cracking-the-Coding-Interview

C++
9
star
3

InterviewBit-Topicwise-Solutions

C++
6
star
4

Juspay-Developer-Hiring-Challenge-June---2022

Juspay Developer Hiring Challenge June - 2022 Sol code in C++
C++
6
star
5

Leetcode-Company-Wise

This repository provides all LeetCode Premium Company Wise Questions
4
star
6

Competitive-Programming

C++
4
star
7

LeetCode-Algorithms-Solutions-Topicwise

C++
3
star
8

Image-Editor-App

Image Editor create your own animated gifs resize crop avatars and images. Photo tool for your favorite pictures. Edit an image here fast and easy ...
JavaScript
3
star
9

CPP-Standard-Template-Library-STL

C++
3
star
10

Social-Network-Prototype

This Network Prototype is in full JavaScript and HTML. Talking about the project, it contains a user side from where a user can view, share a post, photos and many more.
HTML
2
star
11

Jeevan-kumar-Raj_Old.github.io

Web Portfolio to showcase acadmics, skills, projects and contact details in better manner.
CSS
1
star
12

June-LeetCoding-Challenge

It consists of 30 daily problems over the month of June. A problem is added here each day, and you have 24 hours to make a valid submission for it in order to be eligible for rewards.
C++
1
star
13

Task-1-User-List

Create a CRUD project that fetches users from https://jsonplaceholder.typicode.com/users. The crud application will: - Display each user on a card
JavaScript
1
star
14

2048-Game

2048 is a single-player sliding tile puzzle video game
JavaScript
1
star
15

ReactNative-Projects

Some ReactNative Clone Projects
JavaScript
1
star
16

SimpleTaskTracker_ReactJS

JavaScript
1
star
17

Task-Tracker-App

JavaScript
1
star
18

COVID-19_TRACKER

JavaScript
1
star
19

Online-Shop-MERN-

JavaScript
1
star
20

Task-2-Weather-Application

API key that provides 1,000,000 calls/month). - Ability for users to search for a city (It can be from any location/country). - Display weather for searched city.
JavaScript
1
star
21

React-Weather

JavaScript
1
star
22

Movies-app

JavaScript
1
star
23

Nested-To-Do-list-react

JavaScript
1
star
24

coding-test

JavaScript
1
star
25

Crimes-Reporting-and-Missing-People-Finder-App-in-React

JavaScript
1
star
26

MERN-Stack-Auth-System

JavaScript
1
star
27

React-CRUD-with-without-redux

JavaScript
1
star
28

MiniYoutube-ReactJS

JavaScript
1
star
29

NODEJS-ZOOM-CLONE

JavaScript
1
star
30

Random-Password-Generator

The Random Password Generator is a simple project developed using HTML, CSS, and JavaScript.
HTML
1
star
31

Javascript-Weather-App

JavaScript
1
star
32

FruitCatcher

This game is an interesting game. The player has to collect the falling fruits into the basket.
HTML
1
star
33

Love-Calculator

This is fun Project to calculate the love b/w GF & BF
JavaScript
1
star
34

July-LeetCoding-Challenge

This Challenge is beginner-friendly and available to both Premium and non-Premium users. It consists of 31 daily problems over the month of July. A problem is added here each day,
C++
1
star
35

Jeevan-kumar-Raj

1
star
36

React-weather-app

In this project, you can simply get the weather details of your locality.
JavaScript
1
star
37

Competitive-Programming-Cracking-the-Coding-Interview-Best-Study-Material

1
star
38

JPMorgan-Chase-Virtual-Internship

To explore life as a software engineer at JPMorgan Chase and obtain valuable technology skills required to drive your career in the direction you want it to go.
Python
1
star
39

LeetCode-30-Day-Challenge

In order to help you stay focussed, LeetCode is running the 30-Day LeetCoding Challenge for the month of April. Each day, we'll challenge you ...
C++
1
star
40

Facebook-in-PHP

This is a web application project implemented in PHP. Programming Languages used in this project are HTML, CSS, PHP, JavaScript, AJAX. Just like the “Facebook” we use, this project is almost the same
PHP
1
star
41

Portfolio_Website_React-JS

JavaScript
1
star
42

Bookmarker

Bookmarker is a simple project in HTML5, CSS, and JavaScript. This is an interesting project. The project is for adding the records of the different sites that you want to mark for later visit.
HTML
1
star
43

May-LeetCoding-Challenge

This Challenge is beginner-friendly and available to both Premium and non-Premium users. It consists of 31 daily problems over the month of May.
C++
1
star
44

HTML-PLAYGROUND

HTML Playground is a simple project developed using HTML, CSS, and JavaScript. When you open the project, you can see the editor page on your browser where you can type code on one side of the page. Also, see its results on another side at the same time.
JavaScript
1
star
45

Sketch-Pad-App

The Sketch Pad is a simple drawing application. This whole is in html5 and Javascript programming language. You can draw with the help of the cursor.
HTML
1
star
46

KPMG-Virtual-Internship

Take the mystery out of big data and learn what it’s like to produce business results with the KPMG data analytics team.
Jupyter Notebook
1
star
47

TODO-List-Web-App

The ToDo List Web App is a simple project developed using JavaScript, bootstrap, and HTML. This project is an interesting project. Here, the user can add the number of to-do work details and you can see the details stored in the list form. Also, the user ...
HTML
1
star
48

Product-Management

Product Management is a simple project in HTML5, CSS, and JavaScript. This is an interesting project. The project is for adding the different product records of the sneakers. This project uses Crud operation for the management system.
HTML
1
star
49

Order-Book

Python
1
star
50

Small-Tasks

1.Write function for hook to consume custom events related to Document or Window closing a Pop-up if the user clicks outside the Pop-Up. 2.Write an example of Interceptor to modify HTTP requests. Ensure that each field/parameter is trimmed before request is processed.3.Write an example to Interceptor to modify response received from any API’s before it is sent to client.4.Write an example of custom Higher Order Component to make its children center aligned.5.Write a custom function that lets you deep compare dependencies and then re-render if any changes are detected.6.Write an example React context and provider
JavaScript
1
star
51

August-LeetCoding-Challenge

This Challenge is beginner-friendly and available to both Premium and non-Premium users. It consists of 31 daily problems over the month of August.
C++
1
star
52

School-Management-SITE

School Management site is a is a complete school management software design to automate a school’s diverse operations from classes, exams to school events . This project is write by PHP and MYSQL.
JavaScript
1
star
53

react-movie-searcher

JavaScript
1
star
54

Weather-Forecast-App

It is a simple project developed using JavaScript, CSS, and HTML. This project is an application to find a weather condition of a given city both the current and 5-Days forecast at the same time. The server-side API used to get a response data object is retrieved from the Open Weather API.
JavaScript
1
star