50 System Design Interview Questions

CodeSwiftr • Printable web version (use your browser “Print → Save as PDF”)

Try Interview Simulator See how it works
Tip: don’t just read. Practice explaining your approach out loud. That’s the skill that gets offers.
# 50 System Design Interview Questions

**A CodeSwiftr Guide**
*Ace your next system design interview with real questions, organized by topic.*

---

**codeswiftr.com** | Free Engineering Career Resources

Want more interview prep? Visit [codeswiftr.com](https://codeswiftr.com) for guides on behavioral interviews, tech due diligence, and hands-on coding tools.

---

## How to Use This Guide

Each question includes:
- **Difficulty**: Entry (L3-L4), Mid (L5), Senior (L6+)
- **Key Concepts**: The 2-3 ideas the interviewer expects you to discuss
- **Time Guidance**: Most system design rounds are 35-45 minutes. Practice scoping in the first 5 minutes.

**General Framework for Every Question:**
1. Clarify requirements and constraints (functional + non-functional)
2. Estimate scale (users, QPS, storage)
3. Define the API / data model
4. Draw a high-level architecture
5. Deep-dive into 1-2 critical components
6. Discuss trade-offs, bottlenecks, and failure modes

---

## Section 1: Distributed Systems Fundamentals

### Q1. Design a URL Shortener (e.g., bit.ly)
**Difficulty:** Entry
**Key Concepts:** Hashing vs. auto-increment IDs, read-heavy workload optimization, 301 vs. 302 redirects
**What interviewers look for:** How you handle collisions, your caching strategy for hot URLs, and whether you consider analytics tracking.

### Q2. Design a Rate Limiter
**Difficulty:** Entry
**Key Concepts:** Token bucket vs. sliding window algorithms, distributed rate limiting with Redis, race conditions in counter updates
**What interviewers look for:** Understanding of different algorithm trade-offs and how to make it work across multiple application servers.

### Q3. Design a Distributed Key-Value Store
**Difficulty:** Senior
**Key Concepts:** Consistent hashing, replication strategies (quorum reads/writes), conflict resolution (vector clocks vs. last-write-wins)
**What interviewers look for:** CAP theorem understanding, how you handle node failures, and your approach to data partitioning.

### Q4. Design a Distributed Lock Service (e.g., Chubby / ZooKeeper)
**Difficulty:** Senior
**Key Concepts:** Consensus protocols (Paxos/Raft), lease-based locking, fencing tokens to prevent stale locks
**What interviewers look for:** Understanding of why distributed locks are hard, split-brain scenarios, and lock expiration.

### Q5. Design a Unique ID Generator for a Distributed System
**Difficulty:** Mid
**Key Concepts:** Snowflake IDs (timestamp + machine ID + sequence), clock skew handling, ordering guarantees vs. uniqueness
**What interviewers look for:** Why UUIDs may not be ideal (not sortable, large), and how to coordinate across data centers.

### Q6. Design a Service Discovery System
**Difficulty:** Mid
**Key Concepts:** Client-side vs. server-side discovery, health checking, consistency vs. availability trade-offs in the registry
**What interviewers look for:** How services register/deregister, handling stale entries, and integration with load balancing.

### Q7. Design a Distributed Configuration Management System
**Difficulty:** Mid
**Key Concepts:** Push vs. pull config updates, versioning and rollback, consistency across thousands of servers
**What interviewers look for:** How you handle config propagation latency, feature flags, and canary rollouts.

---

## Section 2: Data Storage and Databases

### Q8. Design a Database Sharding Strategy for a Social Network
**Difficulty:** Senior
**Key Concepts:** Shard key selection, cross-shard queries, resharding without downtime
**What interviewers look for:** Why user_id sharding works for profiles but fails for feeds, and how you handle hot shards (celebrity accounts).

### Q9. Design a Time-Series Database (e.g., for IoT Metrics)
**Difficulty:** Senior
**Key Concepts:** Write-optimized storage (LSM trees), downsampling/retention policies, compression techniques for time-series data
**What interviewers look for:** How you handle high write throughput, query patterns (range scans), and storage efficiency.

### Q10. Design a Search Autocomplete System
**Difficulty:** Mid
**Key Concepts:** Trie data structures, prefix matching at scale, ranking by frequency/recency
**What interviewers look for:** How to serve suggestions in under 100ms, personalization, and handling typos.

### Q11. Design a Full-Text Search Engine (e.g., Elasticsearch)
**Difficulty:** Senior
**Key Concepts:** Inverted indexes, tokenization and analyzers, distributed search with scatter-gather
**What interviewers look for:** Relevance scoring (TF-IDF / BM25), index sharding, and near-real-time indexing.

### Q12. Design a Data Warehouse for Analytics
**Difficulty:** Mid
**Key Concepts:** Star schema vs. snowflake schema, columnar storage, ETL vs. ELT pipelines
**What interviewers look for:** How you separate OLTP from OLAP workloads, materialized views, and query optimization.

### Q13. Design a Distributed Cache (e.g., Memcached/Redis Cluster)
**Difficulty:** Mid
**Key Concepts:** Cache invalidation strategies, consistent hashing for partitioning, hot key mitigation
**What interviewers look for:** Cache-aside vs. write-through vs. write-behind patterns, thundering herd prevention, and eviction policies.

### Q14. Design an Object Storage System (e.g., S3)
**Difficulty:** Senior
**Key Concepts:** Erasure coding vs. replication, metadata management at scale, eventual consistency for object listings
**What interviewers look for:** How you ensure durability (11 nines), handle large objects (multipart upload), and manage namespaces.

---

## Section 3: Messaging and Event Systems

### Q15. Design a Message Queue (e.g., Kafka)
**Difficulty:** Senior
**Key Concepts:** Partitioned log architecture, consumer groups, exactly-once semantics vs. at-least-once
**What interviewers look for:** How you handle ordering guarantees, consumer lag, and retention policies.

### Q16. Design a Notification System (Push, Email, SMS)
**Difficulty:** Mid
**Key Concepts:** Fan-out strategies, priority queuing, delivery guarantees across channels
**What interviewers look for:** Rate limiting per user, template management, and tracking delivery/open rates.

### Q17. Design a Real-Time Chat System (e.g., Slack / WhatsApp)
**Difficulty:** Mid
**Key Concepts:** WebSocket connection management, message ordering, online presence tracking
**What interviewers look for:** How you handle millions of concurrent connections, message persistence, and group chat fan-out.

### Q18. Design a Pub/Sub System for Microservices
**Difficulty:** Mid
**Key Concepts:** Topic-based vs. content-based routing, dead letter queues, back-pressure handling
**What interviewers look for:** Decoupling producers and consumers, message schema evolution, and replay capability.

### Q19. Design an Event Sourcing System
**Difficulty:** Senior
**Key Concepts:** Event store design, projections/read models, snapshots for performance
**What interviewers look for:** CQRS pattern, event versioning, and how to rebuild state from events.

---

## Section 4: Web-Scale Applications

### Q20. Design a News Feed System (e.g., Facebook / Twitter)
**Difficulty:** Senior
**Key Concepts:** Fan-out on write vs. fan-out on read, feed ranking algorithms, real-time updates
**What interviewers look for:** How you handle celebrity users (hybrid fan-out), feed caching, and content deduplication.

### Q21. Design a Video Streaming Platform (e.g., YouTube / Netflix)
**Difficulty:** Senior
**Key Concepts:** Adaptive bitrate streaming (HLS/DASH), CDN architecture, video transcoding pipeline
**What interviewers look for:** Upload processing workflow, thumbnail generation, and how you minimize buffering.

### Q22. Design an E-Commerce Platform (Product Catalog + Checkout)
**Difficulty:** Mid
**Key Concepts:** Inventory management (optimistic vs. pessimistic locking), shopping cart persistence, payment idempotency
**What interviewers look for:** How you prevent overselling, handle flash sales, and integrate payment processors.

### Q23. Design a Ride-Sharing Service (e.g., Uber / Lyft)
**Difficulty:** Senior
**Key Concepts:** Geospatial indexing (geohash / quadtree), real-time location tracking, matching algorithms
**What interviewers look for:** How you handle supply/demand balancing, ETA calculation, and surge pricing.

### Q24. Design a Hotel / Flight Booking System
**Difficulty:** Mid
**Key Concepts:** Distributed transactions for reservation, overbooking strategies, search with complex filters
**What interviewers look for:** How you handle concurrent bookings, pricing engines, and calendar availability.

### Q25. Design a Food Delivery Platform (e.g., DoorDash)
**Difficulty:** Mid
**Key Concepts:** Order lifecycle state machine, delivery time estimation, restaurant capacity management
**What interviewers look for:** Real-time order tracking, driver assignment optimization, and batching orders.

### Q26. Design a Social Media Photo Sharing App (e.g., Instagram)
**Difficulty:** Mid
**Key Concepts:** Image storage and CDN delivery, feed generation, content moderation pipeline
**What interviewers look for:** Image resizing/optimization, hashtag search, and explore/recommendation algorithms.

---

## Section 5: Infrastructure and Platform

### Q27. Design a Content Delivery Network (CDN)
**Difficulty:** Senior
**Key Concepts:** Edge caching and cache hierarchies, DNS-based routing, cache invalidation at scale
**What interviewers look for:** Origin shielding, TLS termination at the edge, and handling cache stampedes.

### Q28. Design a Load Balancer
**Difficulty:** Mid
**Key Concepts:** L4 vs. L7 load balancing, health checking, session affinity vs. stateless routing
**What interviewers look for:** Algorithms (round-robin, least connections, consistent hashing), graceful draining, and handling backend failures.

### Q29. Design a CI/CD Pipeline System
**Difficulty:** Mid
**Key Concepts:** Job scheduling and dependency DAGs, artifact storage, parallel test execution
**What interviewers look for:** How you handle flaky tests, build caching, and deployment rollback.

### Q30. Design a Container Orchestration System (e.g., Kubernetes)
**Difficulty:** Senior
**Key Concepts:** Scheduling algorithms (bin packing), service mesh, rolling deployments
**What interviewers look for:** How you handle resource limits, auto-scaling, and pod networking.

### Q31. Design a Logging and Monitoring Platform
**Difficulty:** Mid
**Key Concepts:** Log aggregation pipeline, time-series metrics storage, alerting rules engine
**What interviewers look for:** How you handle log volume (TB/day), structured logging, and correlation across services.

### Q32. Design a Distributed Task Scheduler (e.g., Cron at Scale)
**Difficulty:** Mid
**Key Concepts:** Leader election for task assignment, exactly-once execution guarantees, timezone handling
**What interviewers look for:** How you handle missed schedules, task retries, and priority queuing.

---

## Section 6: Security and Authentication

### Q33. Design an Authentication System (OAuth 2.0 + SSO)
**Difficulty:** Mid
**Key Concepts:** Token lifecycle (access + refresh tokens), OAuth 2.0 flows, session management
**What interviewers look for:** How you handle token revocation, multi-factor auth, and cross-service auth propagation.

### Q34. Design a Permission / Authorization System (RBAC + ABAC)
**Difficulty:** Mid
**Key Concepts:** Role-based vs. attribute-based access control, policy evaluation engine, permission inheritance
**What interviewers look for:** How you handle complex hierarchies, caching authorization decisions, and auditing.

### Q35. Design an API Gateway
**Difficulty:** Mid
**Key Concepts:** Request routing, rate limiting, authentication/authorization at the edge
**What interviewers look for:** Plugin architecture, request/response transformation, and circuit breaking.

---

## Section 7: Data Processing and ML Systems

### Q36. Design a Web Crawler
**Difficulty:** Mid
**Key Concepts:** URL frontier management, politeness policies (robots.txt, crawl rate), deduplication
**What interviewers look for:** How you handle billions of pages, prioritization, and detecting content changes.

### Q37. Design a Real-Time Analytics Dashboard
**Difficulty:** Mid
**Key Concepts:** Stream processing (Kafka Streams / Flink), pre-aggregation, approximate counting (HyperLogLog)
**What interviewers look for:** Latency vs. accuracy trade-offs, handling late-arriving data, and windowing strategies.

### Q38. Design a Recommendation Engine
**Difficulty:** Senior
**Key Concepts:** Collaborative filtering vs. content-based, embedding-based retrieval, two-stage ranking (retrieval + ranking)
**What interviewers look for:** Cold start problem, real-time feature serving, and A/B testing recommendations.

### Q39. Design a Machine Learning Feature Store
**Difficulty:** Senior
**Key Concepts:** Online vs. offline feature serving, feature freshness, point-in-time correctness for training
**What interviewers look for:** How you avoid training-serving skew, handle feature versioning, and manage compute costs.

### Q40. Design a Fraud Detection System
**Difficulty:** Senior
**Key Concepts:** Real-time scoring pipeline, feature engineering from transaction streams, model retraining loop
**What interviewers look for:** Latency requirements (sub-100ms), handling concept drift, and balancing precision vs. recall.

---

## Section 8: File and Data Systems

### Q41. Design a Distributed File System (e.g., GFS / HDFS)
**Difficulty:** Senior
**Key Concepts:** Chunk-based storage, master-slave architecture for metadata, replication and fault tolerance
**What interviewers look for:** How you handle master failover, chunk placement strategy, and consistency of file metadata.

### Q42. Design a Collaborative Document Editor (e.g., Google Docs)
**Difficulty:** Senior
**Key Concepts:** Operational transformation (OT) vs. CRDTs, cursor position synchronization, conflict resolution
**What interviewers look for:** Real-time sync architecture, undo/redo across collaborators, and offline editing.

### Q43. Design a File Sync Service (e.g., Dropbox)
**Difficulty:** Mid
**Key Concepts:** Chunked file storage, delta sync, conflict resolution for concurrent edits
**What interviewers look for:** Bandwidth optimization, handling large files, and notification of changes across devices.

### Q44. Design a Code Repository Hosting Service (e.g., GitHub)
**Difficulty:** Senior
**Key Concepts:** Git object storage at scale, pull request workflow, code search indexing
**What interviewers look for:** How you store and serve large repos, handle merge conflicts, and implement code review features.

---

## Section 9: Reliability and Operations

### Q45. Design a Disaster Recovery System
**Difficulty:** Senior
**Key Concepts:** RPO vs. RTO, active-passive vs. active-active failover, data replication across regions
**What interviewers look for:** How you prioritize which services to recover first, testing failover regularly, and cost trade-offs.

### Q46. Design a Circuit Breaker and Retry Framework
**Difficulty:** Mid
**Key Concepts:** Circuit breaker states (closed/open/half-open), exponential backoff with jitter, bulkhead isolation
**What interviewers look for:** How you prevent cascading failures, when to use retries vs. circuit breakers, and timeout configuration.

### Q47. Design a Feature Flag System
**Difficulty:** Entry
**Key Concepts:** Flag evaluation at the edge, percentage rollouts, user segment targeting
**What interviewers look for:** How you handle flag propagation delay, A/B testing integration, and flag lifecycle management.

### Q48. Design a Health Check and Auto-Healing System
**Difficulty:** Mid
**Key Concepts:** Liveness vs. readiness probes, cascading failure detection, automated remediation actions
**What interviewers look for:** How you avoid false positives, handle flapping services, and escalation policies.

### Q49. Design a Multi-Region Deployment Strategy
**Difficulty:** Senior
**Key Concepts:** Data sovereignty, cross-region replication latency, global load balancing
**What interviewers look for:** How you route users to the nearest region, handle writes across regions, and manage deployment ordering.

### Q50. Design a Capacity Planning and Auto-Scaling System
**Difficulty:** Mid
**Key Concepts:** Predictive vs. reactive scaling, scaling metrics selection, cool-down periods
**What interviewers look for:** How you handle sudden traffic spikes, scale-to-zero for cost savings, and capacity reservations.

---

## Study Strategy: How to Prepare

### Week 1-2: Foundations
- Master the framework (requirements, estimation, API, architecture, deep-dive, trade-offs)
- Study questions 1-7 (distributed systems fundamentals)
- Practice estimating QPS, storage, and bandwidth for each system

### Week 3-4: Storage and Data
- Study questions 8-14 (databases and storage)
- Understand when to use SQL vs. NoSQL, and which NoSQL type fits each use case
- Practice drawing data models for each system

### Week 5-6: Application Layer
- Study questions 15-26 (messaging and web-scale apps)
- Focus on the 3-4 most likely to appear at your target company
- Practice explaining trade-offs out loud (record yourself)

### Week 7-8: Infrastructure and Advanced
- Study questions 27-50 (infrastructure, security, ML, reliability)
- Focus on questions relevant to your target company's domain
- Do at least 5 mock interviews with a partner

### Key Principles for Every Answer
1. **There is no perfect answer** -- interviewers want to see your thought process
2. **Always discuss trade-offs** -- every design decision has pros and cons
3. **Numbers matter** -- back-of-envelope calculations show engineering maturity
4. **Start simple, then optimize** -- a working design that you iterate on beats a complex design you cannot explain
5. **Ask clarifying questions** -- it shows you think before you build

---

## Quick Reference: Concepts That Come Up Repeatedly

| Concept | Where It Appears |
|---------|-----------------|
| Consistent hashing | Q3, Q5, Q13, Q28 |
| CAP theorem | Q3, Q4, Q14, Q49 |
| Fan-out strategies | Q16, Q17, Q20 |
| Sharding | Q8, Q11, Q15, Q44 |
| Caching | Q1, Q10, Q13, Q20, Q27 |
| Leader election | Q4, Q32, Q41 |
| Event-driven architecture | Q15, Q18, Q19, Q37 |
| Rate limiting | Q2, Q16, Q35 |
| Idempotency | Q15, Q22, Q46 |
| Circuit breakers | Q35, Q46, Q48 |

---

*This guide is brought to you by [CodeSwiftr](https://codeswiftr.com). For more engineering career resources, coding tools, and interview prep, visit us at codeswiftr.com.*

*Found this helpful? Share it with a friend who is preparing for system design interviews.*