Skip to main content
โšก Calmops

System Design Interview Guide: Complete Patterns and Approaches

System Design Interview Guide: Complete Patterns and Approaches

System design questions are a crucial part of technical interviews for senior engineering roles. This guide covers fundamental patterns, common approaches, and building blocks for designing large-scale systems.

What is System Design?

System design involves making architectural decisions about how software systems should be built. It encompasses:

  • Functional requirements: What the system should do
  • Non-functional requirements: Performance, scalability, reliability
  • Technical constraints: Budget, timeline, existing infrastructure

Common System Design Concepts

CAP Theorem

CAP Theorem states that a distributed system can only provide 2 of 3 guarantees:

    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                                     โ”‚
    โ”‚         Consistency                 โ”‚
    โ”‚            โšก โšก                    โ”‚
    โ”‚          โ†™       โ†˜                 โ”‚
    โ”‚       โ†™             โ†˜              โ”‚
    โ”‚   Availability โšก โšก                  โ”‚
    โ”‚       โ†˜             โ†™              โ”‚
    โ”‚         โ†˜         โ†™                โ”‚
    โ”‚           Partition                 โ”‚
    โ”‚           Tolerance                 โ”‚
    โ”‚                                     โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

- Consistency (C): All nodes see the same data
- Availability (A): Every request gets a response
- Partition Tolerance (P): System works despite network failures

ACID vs BASE

ACID BASE
Atomicity Basically Available
Consistency Soft state
Isolation Eventual consistency
Durability

Scalability Basics

Vertical vs Horizontal Scaling

Vertical Scaling (Scale Up)          Horizontal Scaling (Scale Out)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     โ”‚             โ”‚       โ”‚ โ”‚       โ”‚ โ”‚       โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚             โ”‚  App  โ”‚ โ”‚  App  โ”‚ โ”‚  App  โ”‚
โ”‚    โ”‚  Server โ”‚      โ”‚             โ”‚       โ”‚ โ”‚       โ”‚ โ”‚       โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚        โ†‘           โ”‚                 โ†‘         โ†‘         โ†‘
โ”‚    More CPU/RAM    โ”‚             Load Balancer
โ”‚                     โ”‚                 
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Database Scaling

Read Replicas                    Sharding
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Main   โ”‚                    โ”‚ Shard 1  โ”‚ โ”‚ Shard 2  โ”‚
โ”‚ Database โ”‚โ”€โ”€โ”€Replicationโ”€โ”€โ–ถ  โ”‚ (Users A-M)โ”‚ โ”‚(Users N-Z)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ†‘
  Reads/Writes
      โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            โ”‚
โ–ผ            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Read    โ”‚ โ”‚  Read    โ”‚
โ”‚  Replica โ”‚ โ”‚  Replica โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Common Building Blocks

1. Load Balancer

# Load balancing strategies
class LoadBalancer:
    def __init__(self, servers):
        self.servers = servers
    
    # Round Robin
    def round_robin(self):
        return self.servers[self.index % len(self.servers)]
    
    # Least Connections
    def least_connections(self):
        return min(self.servers, key=lambda s: s.connections)
    
    # Weighted Round Robin
    def weighted_rr(self):
        # Servers with higher weight get more requests
        pass
    
    # IP Hash (sticky sessions)
    def ip_hash(self, client_ip):
        return self.servers[hash(client_ip) % len(self.servers)]

2. Caching

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Cache Hierarchy                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                      โ”‚
โ”‚  Browser โ”€โ”€โ–ถ CDN โ”€โ”€โ–ถ Load Balancer โ”€โ”€โ–ถ App Server โ”‚
โ”‚     โ”‚         โ”‚                         โ”‚            โ”‚
โ”‚     โ–ผ         โ–ผ                         โ–ผ            โ”‚
โ”‚  Cache    Edge Cache              Redis/Memcached  โ”‚
โ”‚                                               โ”‚    โ”‚
โ”‚                                               โ–ผ    โ”‚
โ”‚                                         Database   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

3. Database Patterns

-- Read Replica
SELECT * FROM users WHERE id = 1;  -- Read from replica

-- Sharding by User ID
-- Users 1-1,000,000 -> Shard 1
-- Users 1,000,001-2,000,000 -> Shard 2

-- Vertical Partitioning
-- Users table: id, name, email
-- UserProfiles table: user_id, avatar, bio, settings

Design Approaches

Step 1: Requirements Clarification

Ask questions like:
- What are the key features?
- How many users?
- What are the read/write ratios?
- What are the latency requirements?
- Any geographic considerations?

Step 2: High-Level Design

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    User Interface                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Load Balancer                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚               โ”‚                   โ”‚
        โ–ผ               โ–ผ                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Service A  โ”‚ โ”‚  Service B  โ”‚ โ”‚  Service C  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚               โ”‚                   โ”‚
       โ–ผ               โ–ผ                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Cache    โ”‚ โ”‚    Cache    โ”‚ โ”‚    Cache    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚               โ”‚                   โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
                      โ–ผ
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚   Database      โ”‚
            โ”‚ (Primary +      โ”‚
            โ”‚  Replicas)      โ”‚
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Step 3: Component Design

Design each component:

1. API Server
   - REST/GraphQL
   - Authentication (JWT, OAuth)
   
2. Data Storage
   - SQL vs NoSQL
   - Caching strategy
   
3. Message Queue
   - Async processing
   - Event-driven
   
4. Search
   - Full-text search (Elasticsearch)
   - Suggestions

Step 4: Trade-offs

Common Trade-offs:

1. Consistency vs Performance
   - Strong consistency = slower
   - Eventual consistency = faster
   
2. Latency vs Cost
   - More caching = lower latency, higher cost
   - Less caching = higher latency, lower cost
   
3. Availability vs Consistency
   - Always available = eventual consistency
   - Consistent = may be unavailable during partitions

Common System Designs

1. URL Shortener

Requirements:
- Shorten long URLs
- Redirect to original URL
- Track click analytics

Design:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Client     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  API Server  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Database   โ”‚
โ”‚              โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  (Hash +    โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  (URL +     โ”‚
โ”‚              โ”‚     โ”‚   Redirect)  โ”‚     โ”‚   Short ID) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                            โ–ผ
                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                     โ”‚   Cache      โ”‚
                     โ”‚  (Redis)     โ”‚
                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2. Twitter/News Feed

Requirements:
- User follows others
- See chronological feed
- High read throughput

Design:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Client     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  API Server  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ–ผ                   โ–ผ                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Fan-out   โ”‚     โ”‚   Search    โ”‚     โ”‚  Analytics  โ”‚
โ”‚  Service   โ”‚     โ”‚   Service   โ”‚     โ”‚   Service   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚
       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Message    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Cache     โ”‚
โ”‚  Queue      โ”‚     โ”‚  (Redis)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

3. Real-time Chat

Requirements:
- 1:1 messaging
- Group chats
- Online status
- Message history

Design:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   WebSocket  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Chat API    โ”‚
โ”‚  Connection  โ”‚     โ”‚   Server     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                   โ–ผ                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Presence   โ”‚     โ”‚  Message    โ”‚     โ”‚  Notificationโ”‚
โ”‚  Service    โ”‚     โ”‚  Service    โ”‚     โ”‚   Service   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
                          โ–ผ
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚  Database   โ”‚
                   โ”‚(Cassandra) โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Estimation Techniques

Traffic Estimation

ๅ‡่ฎพ:
- 1 million DAU
- ๆฏไธช็”จๆˆทๆฏๅคฉ 10 ๆฌก่ฏทๆฑ‚
- ๅณฐๅ€ผ = ๅนณๅ‡็š„ 3ๅ€

่ฎก็ฎ—:
- QPS = 1M ร— 10 / 86400 โ‰ˆ 115 QPS (ๅนณๅ‡)
- ๅณฐๅ€ผ QPS = 115 ร— 3 = 345 QPS

Storage Estimation

ๅ‡่ฎพ:
- 100 million users
- ๆฏไธช็”จๆˆท 100 ไธชๅธ–ๅญ
- ๆฏไธชๅธ–ๅญ 1KB

่ฎก็ฎ—:
- Storage = 100M ร— 100 ร— 1KB = 10 TB
- ๅŠ ไธŠ 3 ๅนดๅ›พ็‰‡ๅญ˜ๅ‚จ = 100+ TB

Bandwidth

ๅ‡่ฎพ:
- 100 QPS
- ๆฏๆฌกๅ“ๅบ” 10KB

่ฎก็ฎ—:
- Bandwidth = 100 ร— 10KB = 1MB/s
- ๅณฐๅ€ผ = 3MB/s

Interview Tips

Do’s

  1. Clarify requirements - Ask questions before designing
  2. Think out loud - Show your reasoning
  3. Make trade-offs - Explain pros/cons
  4. Start simple - MVP first, then scale
  5. Know the numbers - Estimate capacity

Don’ts

  1. Don’t jump straight to code
  2. Don’t ignore non-functional requirements
  3. Don’t over-engineer the solution
  4. Don’t forget about failure scenarios
  5. Don’t ignore monitoring/operations

External Resources


Comments