136 System Design interview questions with answers
136 System Design interview questions with detailed answers, sorted from basic to advanced. Free to practice, with progress saved automatically.
All System Design interview questions
How would you design a real-time chat system?
How would you design an infinite scroll feed (like Facebook/Twitter)?
How would you design a drag-and-drop form builder?
What are the caching strategies for a frontend app?
What is the CAP Theorem and why does it matter in distributed system design?
How do ACID and BASE differ, and when should each model be used?
What are Vertical and Horizontal Scaling? What are the pros and cons of each?
How does Load Balancing work? What are the common load balancing algorithms?
What is a CDN and how does it improve system performance?
How do Forward Proxy and Reverse Proxy differ? When is each used?
What are Latency and Throughput? Why do they often trade off against each other?
What are the consistency models in distributed systems?
What is Database Sharding? What are common sharding strategies and when should you use it?
What are Read Replicas and how do they help scale a database? What are the limitations?
What is Rate Limiting? What are common algorithms and how to implement it?
What is Connection Pooling and why is it critical for database performance?
What is the CQRS Pattern? When should it be applied and what are the implementation challenges?
What is Event Sourcing? What are its benefits and limitations compared to traditional state storage?
What are horizontal scaling patterns for stateful services? How do you handle session state?
How do Microservices and Monolith differ? When should you migrate to Microservices?
What is an API Gateway? What is its role and key features in a microservices architecture?
What is a Service Mesh and why is it needed in a microservices architecture?
What is the Circuit Breaker Pattern? How does it prevent cascading failures?
What problem does the Saga Pattern solve in microservices? What is the difference between Choreography and Orchestration?
What is Event-Driven Architecture? What are its benefits and implementation challenges?
How do Kafka and RabbitMQ differ? When should you use each?
What is Serverless Architecture? What are its pros, cons, and when is it appropriate?
When should you choose SQL vs NoSQL? What are the deciding factors?
How does Database Indexing work? What are the types of indexes and when should you use them?
What are Normalization and Denormalization? What are the trade-offs and when should you use each?
What is Data Partitioning? What is the difference between Horizontal and Vertical Partitioning, and what are common partitioning strategies?
What is Blob Storage and when should you use it instead of a database? How do you design a file storage system?
What is a Time-Series Database? When is it needed and what are the popular solutions?
How do Data Lake and Data Warehouse differ? When should you use each?
What is Change Data Capture (CDC)? How does it work and what are its use cases?
Design a URL Shortener system like bit.ly. What are the key components and technical decisions?
Design a real-time chat system like WhatsApp or Slack. How do you handle connections and messages?
Design a Notification System supporting push, email, and SMS. What are the key components and how do you ensure reliable delivery?
Design a distributed Rate Limiter for an API. What are the requirements and technical solutions?
Design a News Feed like Facebook or Twitter. What are the fanout strategies and caching approaches?
Design a file storage system like Google Drive or Dropbox. What are the key components?
Design a Search Autocomplete / Typeahead system. How do you optimize for latency and ranking?
Design a payment system like Stripe. How do you ensure correctness and idempotency?
What is Consistent Hashing and what problem does it solve compared to plain `hash(key) % N`?
What is an idempotency key and how do you design a safe payment/POST API for client retries?
Design an auth system with OAuth2/OIDC + JWT: distinguish access vs ID token, why Authorization Code Flow + PKCE, and how to handle token revocation?
How do the three pillars of observability (Logs, Metrics, Traces) differ, and when do you use each to debug a production incident?
What is a multi-region active-active architecture? How does it differ from active-passive and what is the biggest challenge?
What is the expand-and-contract (parallel change) pattern for zero-downtime DB schema migration? Walk through renaming a column.
What is a hot partition / hot key in distributed systems? Why does it happen and how do you mitigate it?
Design a webhook system (like Stripe/GitHub pushing events to customers): how do you ensure delivery, security, and dedup?
What is back-of-the-envelope capacity estimation, and how do you estimate QPS, storage, and bandwidth for a system in an interview?
Design a Twitter-style news feed: how do fan-out on write vs fan-out on read differ, and why use a hybrid for celebrity accounts?
Design a large-scale web crawler: the main components, how to avoid duplicate crawling, and how to be polite to servers.
Design an Uber-style ride-matching system: how do you index locations to find nearby drivers fast, and handle real-time location updates?
Design a video streaming service (YouTube/Netflix): how does adaptive bitrate streaming with HLS work, and what roles do CDN and transcoding play?
What are CQRS and Event Sourcing, and how do they relate?
What is the transactional outbox pattern, and how does it solve the dual-write problem?
Design a scalable distributed key-value store / cache (Dynamo-style). How do you handle partitioning, replication, and consistency?
Design an e-commerce system (catalog, cart, inventory reservation, order/checkout). What are the key components and bottlenecks?
Design a ticket booking / seat selection system (cinema, events). How do you handle concurrency and prevent overselling?
Design a distributed job/task scheduler (periodic jobs, background tasks). How do you guarantee each job runs correctly and only once?
What are leader election and consensus? How does a cluster agree on a single leader (Raft / Paxos)?
Design a nearby-places service (find drivers/restaurants around you). How do you index geospatial data?
How do cache eviction policies differ — LRU, LFU, TTL? When would you pick each?
Integrating VNPay/MoMo: how do returnUrl and IPN differ? Which one do you trust to mark an order as paid?
Bots are creating thousands of fake accounts through your signup form every day. How do you handle it?
An order is stuck in pending because the payment gateway's IPN never arrived. How do you handle that flow?
A customer asks to cancel a paid order and get a refund. How do you design the refund flow?
You let clients upload straight to S3 with presigned URLs. How do you know the upload finished, and how do you stop clients sending the wrong type or an oversized file?
A product listing needs name search (accent-insensitive for Vietnamese), multi-attribute filtering, and sorting. How do you design it?
Management wants to know "who edited this order, what changed, and when". How do you design the audit log?
Your users span multiple time zones but reports are cut by Vietnamese calendar days. How do you handle time?
A post shows a view count. What is wrong with running `UPDATE posts SET views = views + 1` on every page load, and what would you do instead?
At day end, accounting reports that your system totals do not match the payment gateway statement. How do you design reconciliation?
Cinema booking: a user picks seats and has 10 minutes to pay. How do you design the temporary hold?
A room/appointment booking system: how do you guarantee two bookings never overlap on the same resource?
Beyond roles, you need "staff see only their branch's orders" and "customers see only their own". How do you design record-level authorization?
A user asks to delete their account and all personal data, but their orders must be kept for accounting. How do you handle it?
Given a system design question in a 45-minute interview, what sequence do you follow?
What is the difference between functional and non-functional requirements? Why separate them explicitly?
In the first 5 minutes of a design round, what do you ask to clarify the problem?
Which latency numbers should you memorize? How far apart are RAM, SSD, and network reads?
Starting from 10 million daily active users, how do you estimate QPS, storage, and bandwidth?
What are p50, p95, and p99? Why is average latency misleading?
How do SLA, SLO, and SLI differ? How much downtime does 99.9% availability allow?
How should you present the API design step in an interview? What must be settled?
In the data model step, what do you decide and on what basis?
What is a single point of failure? How do you audit a diagram for SPOFs?
Why is calling another service without a timeout dangerous? What should the timeout value be based on?
What does PACELC add to CAP? Where is CAP most often misunderstood in practice?
Why is a request that fans out to many services far slower than any single service? How do you tame the tail?
What is the bulkhead pattern? How does it differ from a circuit breaker, and how does it relate to blast radius?
What does designing for failure mean? What roles do chaos engineering and load shedding play?
At the end of the session, how do you identify the design bottleneck and present trade-offs convincingly?
Your system runs on one server, traffic grows 5x and things slow down. In what order do you tackle it?
What is a sticky session (session affinity)? Why avoid it, and when is it unavoidable?
How does a load balancer know which backends are alive? What goes wrong with misconfigured health checks?
After adding read replicas, users report "I saved it but a reload does not show it". Why, and how do you fix it?
How do you pick a shard key? And what does resharding look like when the choice was wrong?
You already use consistent hashing but load is still uneven across nodes. What do virtual nodes fix?
What are hot keys and hot partitions? How do you detect and handle them?
You limit each user to 100 requests/minute, but with 5 instances a user gets 500. How do you fix it?
How does a queue flatten traffic spikes? What does a steadily growing queue tell you?
Which metric should autoscaling use? Why do you still get errors at peak even with autoscaling on?
Scaling from 4 to 40 instances makes the DB report "too many connections" although each instance kept its old config. Why?
How does designing for a read-heavy system differ from a write-heavy one?
The system is slow but you do not know where the bottleneck is. How do you find it?
Design a link shortener with click analytics for a marketing campaign — how would you approach it?
Design an e-wallet: how do you store balances and transactions so the money is never wrong?
Design a ticketing system with flash sales: prevent overselling and survive the traffic spike?
Design the catalog and product search for an e-commerce marketplace?
Design real-time courier location tracking for a delivery app?
Design 1-1 and group chat: message ordering, read state, and delivery to offline users?
Design a news feed for a content app: how do you build the feed at a few hundred thousand users?
Design a multi-channel notification system (push, SMS, email): channel selection, spam control, and provider failures?
Design article view counting and a daily trending leaderboard?
Design the upload and processing pipeline for user-generated images and video?
Design a medical appointment booking system: manage open slots and prevent double booking?
Design a shared rate limiter for multiple services: where does it live, which algorithm, and what if Redis is down?
Design a time-attendance system for a company of a few thousand employees (app or scanner check-in)?
Design search autocomplete for Vietnamese users: unaccented typing must match accented data, under 100ms?
Design a shopping cart that syncs across web and app, including for logged-out users?
Design a simple product recommendation system when the company has no ML team?
A 5-person team, product live for 6 months — should you split into microservices now?
What criteria do you use to split a system into services? What does "bounded context" mean in practice?
Why should each service own its database? Without JOINs, how do you handle reporting?
A failing request crosses 5 services and logs are scattered — how do you piece it together?
An "order detail" screen needs data from Order, User, Payment and Shipping — how do you fetch it?
How does distributed tracing work? What are traces and spans, and how does context cross a message queue?
What problem does service discovery solve? On Kubernetes, do you still need Eureka/Consul?
What is consumer-driven contract testing? Why not just spin up the whole system and run integration tests?
A slow (not dead) dependency takes down the whole system — why, and what stops it?
For an order saga: choreography or orchestration, and what if a compensation cannot undo the work?
Extracting from a live monolith with the strangler fig pattern — what are the concrete steps and the data traps?
What costs do small teams underestimate when moving to microservices? What capabilities must exist first?