system-design-primer README

The project's README from github.com/donnemartin/system-design-primer. As one markdown file: README.md.

English ∙ 日本語 ∙ 简体中文 ∙ 繁體中文 | العَرَبِيَّة‎ ∙ বাংলা ∙ Português do Brasil ∙ Deutsch ∙ ελληνικά ∙ עברית ∙ Italiano ∙ 한국어 ∙ فارسی ∙ Polski ∙ русский язык ∙ Español ∙ ภาษาไทย ∙ Türkçe ∙ tiếng Việt ∙ Français | Add Translation

Help translate this guide!

The System Design Primer


Motivation

Learn how to design large-scale systems.

Prep for the system design interview.

Learn how to design large-scale systems

Learning how to design scalable systems will help you become a better engineer.

System design is a broad topic. There are a vast number of resources scattered throughout the web on system design principles.

This repo is an organized collection of resources to help you learn how to build systems at scale.

Learn from the open source community

This is a continually updated, open source project.

Contributions are welcome!

Prep for the system design interview

In addition to coding interviews, system design is a required component of the technical interview process at many tech companies.

Practice common system design interview questions and compare your results with sample solutions: discussions, code, and diagrams.

Additional topics for interview prep:

Anki flashcards


The provided Anki flashcard decks use spaced repetition to help you retain key system design concepts.

Great for use while on-the-go.

Coding Resource: Interactive Coding Challenges

Looking for resources to help you prep for the Coding Interview?


Check out the sister repo Interactive Coding Challenges, which contains an additional Anki deck:

Contributing

Learn from the community.

Feel free to submit pull requests to help:

Content that needs some polishing is placed under development.

Review the Contributing Guidelines.

Index of system design topics

Summaries of various system design topics, including pros and cons. Everything is a trade-off.

Each section contains links to more in-depth resources.


Study guide

Suggested topics to review based on your interview timeline (short, medium, long).

Imgur

Q: For interviews, do I need to know everything here?

A: No, you don't need to know everything here to prepare for the interview.

What you are asked in an interview depends on variables such as:

More experienced candidates are generally expected to know more about system design. Architects or team leads might be expected to know more than individual contributors. Top tech companies are likely to have one or more design interview rounds.

Start broad and go deeper in a few areas. It helps to know a little about various key system design topics. Adjust the following guide based on your timeline, experience, what positions you are interviewing for, and which companies you are interviewing with.

Short Medium Long
Read through the System design topics to get a broad understanding of how systems work :+1: :+1: :+1:
Read through a few articles in the Company engineering blogs for the companies you are interviewing with :+1: :+1: :+1:
Read through a few Real world architectures :+1: :+1: :+1:
Review How to approach a system design interview question :+1: :+1: :+1:
Work through System design interview questions with solutions Some Many Most
Work through Object-oriented design interview questions with solutions Some Many Most
Review Additional system design interview questions Some Many Most

How to approach a system design interview question

How to tackle a system design interview question.

The system design interview is an open-ended conversation. You are expected to lead it.

You can use the following steps to guide the discussion. To help solidify this process, work through the System design interview questions with solutions section using the following steps.

Step 1: Outline use cases, constraints, and assumptions

Gather requirements and scope the problem. Ask questions to clarify use cases and constraints. Discuss assumptions.

Step 2: Create a high level design

Outline a high level design with all important components.

Step 3: Design core components

Dive into details for each core component. For example, if you were asked to design a url shortening service, discuss:

Step 4: Scale the design

Identify and address bottlenecks, given the constraints. For example, do you need the following to address scalability issues?

Discuss potential solutions and trade-offs. Everything is a trade-off. Address bottlenecks using principles of scalable system design.

Back-of-the-envelope calculations

You might be asked to do some estimates by hand. Refer to the Appendix for the following resources:

Source(s) and further reading

Check out the following links to get a better idea of what to expect:

System design interview questions with solutions

Common system design interview questions with sample discussions, code, and diagrams.

Solutions linked to content in the solutions/ folder.

Question
Design Pastebin.com (or Bit.ly) Solution
Design the Twitter timeline and search (or Facebook feed and search) Solution
Design a web crawler Solution
Design Mint.com Solution
Design the data structures for a social network Solution
Design a key-value store for a search engine Solution
Design Amazon's sales ranking by category feature Solution
Design a system that scales to millions of users on AWS Solution
Add a system design question Contribute

Design Pastebin.com (or Bit.ly)

View exercise and solution

Imgur

View exercise and solution

Imgur

Design a web crawler

View exercise and solution

Imgur

Design Mint.com

View exercise and solution

Imgur

Design the data structures for a social network

View exercise and solution

Imgur

Design a key-value store for a search engine

View exercise and solution

Imgur

Design Amazon's sales ranking by category feature

View exercise and solution

Imgur

Design a system that scales to millions of users on AWS

View exercise and solution

Imgur

Object-oriented design interview questions with solutions

Common object-oriented design interview questions with sample discussions, code, and diagrams.

Solutions linked to content in the solutions/ folder.

Note: This section is under development

Question
Design a hash map Solution
Design a least recently used cache Solution
Design a call center Solution
Design a deck of cards Solution
Design a parking lot Solution
Design a chat server Solution
Design a circular array Contribute
Add an object-oriented design question Contribute

System design topics: start here

New to system design?

First, you'll need a basic understanding of common principles, learning about what they are, how they are used, and their pros and cons.

Step 1: Review the scalability video lecture

Scalability Lecture at Harvard

Step 2: Review the scalability article

Scalability

Next steps

Next, we'll look at high-level trade-offs:

Keep in mind that everything is a trade-off.

Then we'll dive into more specific topics such as DNS, CDNs, and load balancers.

Performance vs scalability

A service is scalable if it results in increased performance in a manner proportional to resources added. Generally, increasing performance means serving more units of work, but it can also be to handle larger units of work, such as when datasets grow.1

Another way to look at performance vs scalability:

system-design-primer (donnemartin/system-design-primer)

Searching Database…

这是什么?这是一份精心整理、结构清晰的资源合集,专门用来学习如何设计大规模系统,帮助工程师准备系统设计面试。
这是教程、参考清单,还是需要运行的东西?这是一份阅读和学习指南,包含系统设计主题索引、附示例解答的面试题,以及 Anki 闪卡组。无需安装或运行任何软件。
内容是怎么组织的?我应该从哪里开始?内容先是系统设计主题索引(可扩展性、数据库、缓存、负载均衡等),然后是附解答的系统设计面试题和附解答的面向对象设计题。新读者应从 'System design topics: start here' 下的可扩展性讲座和文章开始。
使用它需要什么工具吗?阅读指南不需要任何特殊工具;唯一可选的额外工具是 Anki 应用,如果你想用提供的闪卡组进行间隔重复记忆。
面试前我需要把这里的内容全部学完吗?不需要。README 明确说明你不必什么都懂;学习指南还会根据你的经验和目标公司,给出不同深度的学习安排(短、中、长三种时间线)。
这份指南是给谁看的?适合准备科技公司系统设计面试的工程师,从一线开发人员到架构师和团队负责人都可以用;也适合任何想学习如何构建可扩展系统的人。
系统设计索引涵盖哪些主题?涵盖 DNS、CDN、负载均衡器、微服务、数据库(SQL/NoSQL、复制、分片)、缓存策略、通过消息队列和任务队列实现的异步处理,以及 TCP、UDP、RPC、REST 等通信协议。
里面包含哪些面试题?包含完整的系统设计题,例如设计 Pastebin、Twitter 时间线、网络爬虫和 Mint.com;还有面向对象设计题,例如设计停车场或 LRU 缓存。每道题都附有讨论、代码和示意图。
有没有相关的编程面试准备资源?有。作者还维护了一个姊妹仓库 'Interactive Coding Challenges',其中附有一套专门针对编程面试练习的 Anki 闪卡组。
Size
11 MB
Stars
374.6K
Updated
CommitMar 20
Age
9y
Commits · 90 Days