System design interviews often seem intimidating because of their open-ended nature. But the truth is, most questions can be broken down using a small set of foundational principles.
In this guide, we’ll walk through the must-know fundamentals every software engineer should understand before tackling any system design problem.
🧱 1. Scalability
Scalability is the ability of a system to handle increasing load gracefully.
🔸 Vertical Scaling
- Add more resources (CPU, RAM) to a single server.
- Simple to implement, but has a physical limit.
🔸 Horizontal Scaling
- Add more servers to distribute the load.
- Enables web-scale systems, but adds complexity (e.g., distributed state, coordination).
In interviews, discuss how your architecture can horizontally scale with traffic.
📈 2. Availability
Availability is the system’s ability to respond to requests even under failure conditions.
🔸 High Availability
- Redundant servers across multiple zones.
- Load balancers and failover mechanisms.
- Health checks and automated recovery.
Be ready to describe how to avoid single points of failure (SPOF) in your design.
🔁 3. Consistency
Consistency refers to ensuring all users see the same data at the same time.
🔸 Strong Consistency
- Every read returns the latest write.
- Common in SQL databases.
🔸 Eventual Consistency
- Different nodes may return different values temporarily.
- Common in NoSQL systems like DynamoDB, Cassandra.
Know when to favor one over the other, depending on the use case (e.g., messaging app vs. banking system).
⚖️ 4. CAP Theorem
The CAP theorem says a distributed system can only guarantee two of the following three:
- Consistency
- Availability
- Partition Tolerance
Since network partitions are inevitable, every system design needs to trade off between Consistency and Availability.
Interview tip: Always mention how your design handles the CAP trade-offs.
🌐 5. Load Balancing
Load balancers distribute traffic across backend servers to:
- Prevent overload
- Enable redundancy
- Improve response time
Types of Load Balancers
- Layer 4: Based on IP/TCP (e.g., HAProxy)
- Layer 7: Based on HTTP/URL routing (e.g., NGINX)
In your design, show where load balancers help scale or isolate services.
⚡ 6. Caching
Caching reduces response time and backend load.
Caching Layers
- Browser / CDN Cache (static assets)
- Application-level Cache (e.g., Redis, Memcached)
- Database Query Cache
Cache Strategies
- Write-through, Write-around, Write-back
- Eviction policies: LRU, LFU, TTL
In interviews, caching is a great way to optimize latency or reduce DB bottlenecks.
📦 7. Stateless vs. Stateful Services
- Stateless: Doesn’t store any session data on the server. Easier to scale.
- Stateful: Requires session stickiness or external state store (e.g., Redis for sessions).
Always favor stateless services unless business logic requires shared state (e.g., multiplayer games, collaborative editors).
🛡️ 8. Rate Limiting and Throttling
To prevent abuse and protect system stability:
- Use algorithms like Token Bucket, Leaky Bucket
- Implement per-user or per-IP limits
- Enforce request quotas in APIs
This often comes up in designing APIs or payment systems.
🌐 9. API Design
RESTful API Design Principles
- Use nouns, not verbs:
GET /users
,POST /orders
- Idempotency: Ensure repeated calls don't have unintended side effects
- Versioning:
v1
,v2
support backward compatibility - Use pagination and filtering for scalability
You’ll often be asked to “design APIs” as part of system design discussions.
🧠 How These Show Up in Interviews
Concept | Example Questions |
---|---|
Caching | "Design a news feed. How do you reduce DB load?" |
Load Balancing | "Design a chat app. How do you handle high QPS?" |
CAP Theorem | "Design Dropbox. What trade-offs do you make in storage?" |
Statelessness | "Design a web server. How do you scale login sessions?" |
Rate Limiting | "Design a payment gateway. How do you prevent abuse?" |
✅ Summary
Concept | Why It Matters in Design |
---|---|
Scalability | Handle increasing users/traffic |
Availability | Ensure uptime and fault-tolerance |
Consistency | Guarantee correct data access |