Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
paper
README.org
cheatsheet-featuredesign-A4.pdf
dynamo-summary.png

README.org

1 CheatSheet: Feature Design For Job Interview

linkedin
github
slack


PRs Welcome

File me Issues or star this repo.

1.1 Key Blocks For Feature/System Design

NumNameSummary
1CachingStores data so that future requests of data retrieval can be faster
2Message QueueProvides an asynchronous communications protocol,
3Data Partition & ShardingBreak up a big data volume into many smaller parts
4DB IndexingCreate indexes on multiple columns to speed up table look up
5Pull vs Push model
6Networking: HTTP
7Load balancer
8Concurrency & Communication
9DB replication
10CAP: Consistency/Availability/Partition
11Consistent Hash
12Eventually consistency
13Two-phase commit/Three-phase commit
14API: gRPC vs REST
15Scale up vs Scale outVertical scaling and Horizontal scaling
16Pessimistic And Optimistic Locking
17Session management
18Networking: TCP vs UDP
19API Design
20Consistency patternsWeak consistency, Eventual consistency, Strong consistency
21Availability patternsFail-over vs Replication
22Self ProtectionAPI Rate limit, Circuit breaker, bulkhead
23Data Replication
24Conflict resolutionQuorum, vector lock, reconcile on read/write
25CDN - Content Delivery Network
26Monitoring
27Distributed Systems
28Garbage Collection
29Memory Management
30Concurrency
31Networking: SDN
32Security
33Networking: DNS

1.2 Design Technical Modules

NumNameSummary
1Design a distributed counterlink
2Design a distributed UUID generator
3Implement a timer
4Design An API Rate Limiterlink, link
5Design online/offline status system
6Top URL hits
7Unique url hits
8Delayed task scheduling
9Design a thread-safe Hashmaplink
10Design a distributed Hashmap
11Design a distributed transactions
12Design a load balancer
13Design a client-server API to build a rich document editor
14Design a circuit breaker
15Design a secrets management system
16Design data sync for a distributed system
17Design: A Parking Lot Servicelink
18Design: A URL Redirecting Feature

1.3 Additional Blocks For Feature/System Design

NumNameSummary
1Heartbeats
2Gossip
3Paxos and raft protocol
4CRDTs (Consistent Replicated Data Types)
5Vector Clocks/Version Vectors
6Split brain
7Merkle Tree
8Sloppy Quorum and hinted handoff
9LSM (Log Structured Merge Trees)

https://raw.githubusercontent.com/dennyzhang/cheatsheet.dennyzhang.com/master/cheatsheet-featuredesign-A4/dynamo-summary.png

1.4 Explain workflow: What happens when XXX?

NumNameSummary
1When happens when I search in google?
2How loadbalancer works
3Explain three phase commit model
4Explain HTTP return code301 vs 302, 401 vs 403, 503 vs 504, etc
5Explain Mysql DB replication model
6Explain gossip protocol
7Explain CAP
8Explain Hadoop file system

1.5 Explain tools: how XXX supports XXX?

NumNameSummary
1How JDK implement hashmap?
2Explain java garbage collection model
3Explain raft/etcd
4How OS supports XXX?

1.6 Cloud Design Principles

NumNameSummary
1Fail fast
2Design for failure
3Immutable infrastructure
4Cats vs CattleAvoid snowflake servers
5Auto healing
6Async programming
7GitOps operational model

1.7 Cloud Design Patterns

NumNameSummary
1Ambassador patternCreate helper service to send network requests, besides the main sevice
2Cache-Aside patternLoad data on demand into a cache from a data store
3Circuit Breaker patternIf a request takes too many reousrce, abort it
4Bulkhead patternIsolate elements into pools, so that one fire won’t burn all
5Gateway Aggregation patternAggregate multiple individual requests into a single request
6Priority Queue patternSupport different SLAs for different individual clients
7Strangler patternIncrementally migrate a legacy system piece by piece

1.8 Misc

NumNameSummary
1How to store 2TB data into 3 disks of 1TB. And be tolerant for one disk failureA, B, C. And C = A XOR B
2Find out the difference between two files. Majority of these two are the same#lcs - Longest Common Subsequence
3How to support feature of “diff 1.txt 2. txt”
4Avoid double payment in a distributed payment systemlink

1.9 Top 20 Object-Oriented Design Problems

NumProblemCategory/TagExample
1Cache#linkedlist, #oodesignLeetcode: LRU Cache, Leetcode: LFU Cache, Leetcode: All O`one Data Structure
2Throttling#linkedlist, #oodesignLeetcode: Design Hit Counter, Leetcode: Logger Rate Limiter
3Iterator#oodesignLeetcode: Binary Search Tree Iterator, Leetcode: Design Compressed String Iterator
4Design Log Storage System#oodesignLeetcode: Design Log Storage System
5Linked List with random access#oodesignLeetcode: Design Linked List
6Max Stack#stack , #oodesignLeetcode: Max Stack
7Design HashMap#oodesignLeetcode: Design HashMap
8Circular Queue#oodesignLeetcode: Design Circular Queue, Leetcode: Design Circular Deque
9Trie tree#oodesignLeetcode: Implement Trie (Prefix Tree)
10Get Median#oodesignLeetcode: Find Median from Data Stream
11Range Sum Query#oodesignLeetcode: Range Sum Query - Mutable, Leetcode: Range Sum Query - Immutable
12Design File System#oodesignLeetcode: Design File System
13Insert Delete GetRandom O(1)#oodesign, #randomLeetcode: Insert Delete GetRandom O(1)
14Insert Delete GetRandom O(1) II#oodesign, #randomLeetcode: Insert Delete GetRandom O(1) - Duplicates allowed

1.10 More Resources

License: Code is licensed under MIT License.

https://github.com/donnemartin/system-design-primer

https://github.com/binhnguyennus/awesome-scalability

https://docs.microsoft.com/en-us/azure/architecture/patterns/

You can’t perform that action at this time.