The 4-Step Framework
System design interviews test your ability to design complex systems under constraints. Here's the framework we teach our engineers.
Step 1: Requirements (5 minutes)
Clarify functional and non-functional requirements before drawing anything.
# Design a URL Shortener
Functional: Shorten URLs, Redirect, Custom aliases, Analytics
Non-Functional: 100M URLs/day, 10:1 read:write ratio, 99.9% uptime
Scale: 1,160 writes/sec, 11,600 reads/secStep 2: High-Level Design
Draw the major components and their interactions.
[Client] → [Load Balancer] → [API Server] → [Database]
↓
[Cache Layer]Step 3: Detailed Design
Dive deep into the most critical components.
function generateShortUrl(longUrl) {
const id = generateUniqueId();
return base62Encode(id);
}Common Patterns
Rate Limiting
class RateLimiter {
async isAllowed(userId) {
const key = `ratelimit:${userId}:${Math.floor(Date.now() / 60000)}`;
const count = await this.redis.incr(key);
return count <= 100;
}
}Practice Problems
| System | Key Concepts | Difficulty |
|---|---|---|
| URL Shortener | Hashing, caching, database design | Easy |
| News Feed | Pull vs. push, fanout, ranking | Hard |
| Chat System | WebSockets, presence, message storage | Hard |
| Rate Limiter | Token bucket, sliding window, Redis | Medium |
Conclusion
Practice the framework, not just the solutions. Interviewers want to see your thought process, not a memorized architecture.