System Design Interview – 35 Questions You Should Prepare For
From designing a URL shortener to architecting systems that handle millions of users, these system design interview questions will help you develop the engineering mindset required to build scalable, reliable, and secure applications.
Introduction
Have you ever wondered how YouTube serves billions of videos, how WhatsApp delivers messages in milliseconds, or how Amazon handles thousands of orders simultaneously without losing track of inventory?
Behind these products are carefully designed distributed systems, databases, caching layers, message queues, load balancers, and countless architectural decisions.
This is precisely what system design interviews aim to evaluate.
Unlike traditional coding interviews, where you may be asked to solve a problem using an algorithm or data structure, system design interviews test your ability to think about the bigger picture. Interviewers want to understand how you translate business requirements into technical architectures, identify bottlenecks, handle failures, and make trade-offs between cost, performance, consistency, and availability.
System design interviews are particularly important for senior software engineers, backend developers, engineering managers, software architects, and aspiring CTOs.
In this guide, we will explore 35 important system design interview questions, explain what interviewers expect, and discuss the concepts you should understand before attempting each question.
Whether you are preparing for a technical interview or trying to become a better software architect, this guide will give you a structured starting point.
Part 1: Core System Design Concepts
Before designing complex applications, you need a strong understanding of the fundamental components that make modern systems work.
1. What is system design, and why is it important?
System design is the process of defining a system’s architecture, components, data flows, interfaces, and operational characteristics to satisfy a set of requirements.
It involves deciding how different components communicate, where data is stored, how requests are processed, and what happens when components fail.
A good system design balances several objectives:
- Scalability
- Availability
- Reliability
- Performance
- Security
- Maintainability
- Operational cost
For example, a simple application serving 100 users might run comfortably on a single server. The same architecture may fail when traffic grows to millions of users.
System design helps engineers anticipate these challenges before they become expensive production problems.
2. What is the difference between monolithic and microservices architecture?
A monolithic application is deployed as a single application unit. Its modules may be well separated internally, but they generally share a deployment lifecycle.
Microservices architecture divides an application into independently deployable services that communicate through APIs, messaging, or other interfaces.
Monolithic architecture advantages:
- Simpler initial development and deployment.
- Easier local debugging.
- Fewer distributed communication failures.
- Lower operational overhead for smaller applications.
Microservices architecture advantages:
- Independent deployment and scaling.
- Clearer ownership boundaries for larger teams.
- Ability to choose different technologies where justified.
- Better isolation between certain workloads.
Microservices also introduce network latency, distributed tracing requirements, service discovery, and more complex failure handling.
The right choice is not always microservices. A well-structured monolith is often the best starting point for a new product.
3. What is horizontal scaling versus vertical scaling?
Vertical scaling means increasing the resources available to a single server, such as CPU, RAM, or storage.
Horizontal scaling means adding more servers or instances and distributing work between them.
For example, upgrading a server from 8 GB to 64 GB of RAM is vertical scaling. Adding four application instances behind a load balancer is horizontal scaling.
Horizontal scaling can improve capacity and resilience, but it often requires stateless application instances, shared storage, distributed coordination, and careful database design.
4. What is a load balancer, and how does it work?
A load balancer distributes incoming requests across multiple backend servers.
Common algorithms include:
- Round robin.
- Weighted round robin.
- Least connections.
- Consistent hashing.
- IP-hash-based distribution.
Load balancers can also perform health checks, terminate TLS connections, and route traffic based on hostnames or request paths.
Consider an application with three healthy servers. Instead of sending every request to one server, a load balancer distributes requests across the available instances.
If a server fails its health checks, the load balancer can stop sending it new traffic.
However, a load balancer does not automatically eliminate every single point of failure. It must itself be deployed with appropriate redundancy.
5. What is the difference between latency and throughput?
Latency measures how long an operation takes. Throughput measures how much work a system completes over a period of time.
For example, an API may have an average response time of 100 milliseconds and process 2,000 requests per second.
These metrics describe different aspects of performance.
A system can have high throughput but poor tail latency. Interviewers often expect candidates to discuss percentiles such as p95 and p99 rather than relying exclusively on averages.
A useful design should identify performance targets before selecting infrastructure.
Part 2: Database and Data Architecture Questions
Data storage is one of the most important decisions in system design. The wrong data model or database strategy can become a major bottleneck as a system grows.
6. What is the difference between SQL and NoSQL databases?
SQL databases generally provide relational data models, structured schemas, and powerful querying capabilities. Many support transactions with strong ACID guarantees.
NoSQL is a broad category that includes document databases, key-value stores, wide-column databases, and graph databases.
SQL databases are often suitable for financial transactions, order management, and relational business applications.
NoSQL databases may be useful for flexible document structures, high-volume key-value access, or workloads requiring specific distribution characteristics.
The decision should be based on access patterns, consistency requirements, transaction needs, query complexity, and operational constraints—not simply on which technology is more fashionable.
7. What is database sharding?
Sharding divides a dataset into smaller partitions distributed across multiple database servers.
For example, a user database might partition users by a stable hash of their user ID. Each shard stores only a subset of the records.
Sharding can increase storage capacity and distribute read and write workloads.
However, it also introduces challenges:
- Choosing an appropriate shard key.
- Distributing data evenly.
- Handling cross-shard queries.
- Rebalancing data as the system grows.
- Managing transactions across shards.
A poor shard key can create a hot shard that receives disproportionately high traffic.
Sharding is powerful, but it adds complexity and should be introduced when simpler scaling techniques are insufficient.
8. What is database replication?
Replication maintains copies of data across multiple database nodes.
In primary-replica replication, writes are typically sent to the primary node, while replicas can serve some read requests.
Replication can improve read capacity and help with recovery when a node fails.
However, asynchronous replication can introduce replication lag. A user might write data and then read from a replica that has not yet received the latest update.
This is an important consideration when designing applications that require read-after-write consistency.
9. What is database indexing, and how does it improve performance?
An index is a data structure that helps the database locate records without scanning every row.
For example, an index on email can make a lookup by email much faster when the index is appropriate for the query.
Indexes improve some read operations but require additional storage and can slow down writes because the database must maintain the indexes.
Interviewers may ask how you would index a table containing millions of records. A strong answer starts with the actual queries, filtering conditions, sort order, selectivity, and query plans.
10. What is database normalization versus denormalization?
Normalization organizes relational data to reduce duplication and update anomalies.
Denormalization intentionally duplicates or precomputes data to improve read performance or simplify particular access patterns.
For example, a normalized order database may store customer details separately. A reporting system might maintain a denormalized order view containing selected customer fields to make common queries faster.
Normalization often simplifies data integrity. Denormalization can improve performance but introduces consistency and update-management challenges.
The correct choice depends on the workload and business requirements.
Part 3: Scalability, Caching, and Distributed Systems
As applications grow, repeatedly querying databases or processing every request from scratch becomes expensive. Caching and asynchronous processing can help, but they introduce their own failure modes.
11. What is caching, and where should it be implemented?
Caching stores frequently accessed data in a faster location so that repeated requests can be served with less work.
Common caching layers include:
- Browser caching.
- Content delivery networks.
- Reverse-proxy caching.
- Application-level caching.
- Distributed caches such as Redis.
- Database buffer caches.
For example, a product catalogue may be cached because thousands of users request the same information.
Caching can reduce database load and improve response times. However, it requires a strategy for expiration, invalidation, stale data, and cache failures.
A common interview follow-up is: What happens when a popular cache entry expires and thousands of requests try to rebuild it simultaneously?
This is known as a cache stampede. Techniques such as request coalescing, jittered expiration, and controlled refresh can help mitigate it.
12. What is the difference between cache-aside, write-through, and write-behind caching?
Cache-aside: The application checks the cache first. On a miss, it reads from the database and populates the cache.
Write-through: Data is written to the cache and the underlying data store according to the cache system’s write-through semantics.
Write-behind: Writes are acknowledged or buffered in the cache layer and persisted to the underlying store asynchronously.
Cache-aside is widely used because it is relatively straightforward.
Write-through can simplify certain consistency requirements, while write-behind can improve write performance but introduces additional durability and data-loss considerations if the implementation is not carefully designed.
The key interview point is to explain the consistency, failure, and recovery implications of the chosen strategy.
13. What is the CAP theorem?
The CAP theorem describes a trade-off in distributed data systems when a network partition occurs.
It concerns three properties:
- Consistency: Operations behave as if they observe a single consistent view of data, under the formal CAP definition.
- Availability: Every request received by a non-failing node receives a response.
- Partition tolerance: The system continues operating despite network communication failures between nodes.
When a partition occurs, a system cannot guarantee both CAP consistency and CAP availability in the strict sense simultaneously.
This does not mean that every distributed database is simply either consistent or available in all situations. Real systems offer different consistency models, quorum configurations, and operational trade-offs.
A strong interview answer explains what happens to reads and writes during a partition, rather than just repeating the acronym.
14. What is eventual consistency?
Eventual consistency means that replicas may temporarily disagree, but under suitable conditions, updates will eventually propagate and the replicas will converge.
Consider a social network where a profile update appears immediately on one server but takes a short time to appear on another.
Eventual consistency can be appropriate for some feeds, analytics, and replicated read models.
It may be inappropriate for operations that require strict correctness, such as preventing a bank account from being debited twice or overselling the last item in stock.
The right consistency model depends on the business operation.
15. What is a message queue, and why is it useful?
A message queue allows one component to send work to another component asynchronously.
Instead of sending an email while processing a user registration request, an application can publish an email job to a queue and return a response while a worker processes the job.
Message queues help decouple services, absorb traffic spikes, and support retryable background processing.
However, they introduce delivery semantics, duplicate processing, ordering requirements, dead-letter queues, and monitoring needs.
A robust consumer should generally be idempotent so that processing the same message more than once does not produce incorrect business outcomes.
16. What is the difference between synchronous and asynchronous communication?
In synchronous communication, the caller waits for the operation to complete or return a response.
In asynchronous communication, the caller can continue working while another component processes the request.
Synchronous APIs are often appropriate when the user needs an immediate result. Asynchronous processing is useful for tasks such as sending emails, generating reports, processing images, and running long-running jobs.
A good system design considers the user’s experience, timeout behavior, retry policies, failure handling, and whether eventual completion is acceptable.
17. How do you prevent a single service from overwhelming the rest of a distributed system?
This problem can be addressed using several resilience patterns.
Rate limiting restricts how many requests a client or service can make during a period.
Backpressure signals that a downstream component cannot safely accept more work.
Circuit breakers temporarily stop calls to a failing dependency to prevent repeated failures and resource exhaustion.
Bulkheads isolate resources so that failure or overload in one part of a system does not consume every available resource.
Bounded queues prevent unprocessed work from growing without limits.
These mechanisms are particularly useful when one overloaded service can otherwise cause a chain reaction across the entire application.
Part 4: Real-World System Design Interview Questions
These questions are frequently used to evaluate whether a candidate can turn abstract concepts into a practical architecture.
18. How would you design a URL shortener like Bitly?
A URL shortener converts a long URL into a short identifier that redirects users to the original destination.
A typical architecture includes:
- An API service to create short links.
- A unique ID generation strategy.
- A database mapping short IDs to original URLs.
- A cache for frequently requested links.
- Redirect handlers.
- Analytics and abuse-prevention components.
The key challenges are identifier collisions, read-heavy traffic, hot links, expiration policies, and malicious URLs.
A strong answer should discuss how to generate unique short codes and what HTTP redirect status to use for the intended behavior.
19. How would you design a chat application like WhatsApp?
A chat system must support user identities, conversations, message delivery, message history, and connection management.
A typical design includes:
- Authentication and user services.
- WebSocket gateways for active connections.
- A messaging service.
- Durable message storage.
- Delivery and read receipts.
- Push notifications for offline users.
- Queues or event streams for asynchronous processing.
Important challenges include ordering, duplicate delivery, reconnecting after network failures, offline message delivery, and scaling persistent connections.
You should also explain how messages are routed to users connected through different gateway instances.
20. How would you design a video streaming platform like YouTube?
A video platform needs to accept uploads, process videos into multiple formats, store media, and deliver content efficiently around the world.
A high-level architecture may contain:
- An upload service.
- Object storage for original videos.
- An asynchronous transcoding pipeline.
- Metadata and search services.
- A content delivery network.
- Recommendation and analytics services.
Video processing should generally occur asynchronously because transcoding can be resource-intensive.
The CDN reduces latency and origin load by serving cached content from locations closer to viewers.
A strong answer should address upload reliability, adaptive bitrate streaming, storage costs, access control, and popular-video traffic spikes.
21. How would you design a notification system?
A notification system delivers email, SMS, push notifications, or in-app messages triggered by business events.
A typical design uses an API or event producer, a durable queue, notification workers, provider integrations, retry logic, and delivery-status tracking.
Key challenges include duplicate notifications, provider rate limits, failed delivery, user preferences, and message prioritization.
You should explain how you prevent the same business event from generating multiple unwanted notifications and how you handle a third-party provider outage.
22. How would you design an e-commerce platform?
An e-commerce system includes product catalogues, search, inventory, shopping carts, checkout, payment processing, and order management.
A reasonable initial design separates the main business modules and uses a relational database for transactional records.
Caching can improve catalogue performance, while queues can handle background work such as emails and analytics.
The hardest parts often involve inventory correctness, payment failures, duplicate checkout requests, and consistency across orders, payments, and stock.
A strong answer should explain how the system avoids overselling and how it reconciles payment status when external payment providers time out.
23. How would you design a ride-hailing application like Uber?
A ride-hailing system connects riders and drivers using location, availability, matching, trip state, and payment services.
The architecture may include location ingestion, geospatial indexing, a matching engine, trip management, notifications, and payment processing.
The challenges include high-frequency location updates, geographic partitioning, real-time matching, driver availability, and handling simultaneous requests for the same driver.
A good answer should also discuss how the system behaves when a rider or driver loses network connectivity during an active trip.
24. How would you design a rate limiter?
A rate limiter controls how many requests a user, API key, IP address, or service can make during a specified period.
Common algorithms include:
- Fixed window.
- Sliding window.
- Token bucket.
- Leaky bucket.
A token bucket allows requests to consume available tokens and replenishes tokens at a configured rate. It can permit short bursts while limiting sustained traffic.
For a distributed API, the design must account for multiple application instances, shared counters, concurrency, and the latency of the rate-limiting store.
You should also discuss what happens when the rate-limiter dependency itself becomes unavailable.
25. How would you design a search autocomplete system?
An autocomplete system returns suggestions as a user types.
A basic implementation may use a prefix index, trie, search index, or specialized autocomplete engine.
The system should minimize latency, rank suggestions appropriately, and avoid sending unnecessary requests for every keystroke.
Common techniques include debouncing, caching popular prefixes, limiting result counts, and using ranking signals.
For large datasets, the challenge is maintaining an efficient index while handling updates and high query volumes.
26. How would you design a file storage service like Google Drive?
A file storage system needs to support uploads, downloads, metadata, access control, sharing, and version history.
A typical architecture uses object storage for file contents and a database for metadata and permissions.
Large uploads may use multipart upload, while background workers generate previews and thumbnails.
Important considerations include resumable uploads, file integrity, deduplication, access control, storage lifecycle policies, and disaster recovery.
You should explain how the system handles a user uploading a large file over an unstable network connection.
27. How would you design a logging and monitoring platform?
A monitoring platform collects logs, metrics, and traces from applications and infrastructure.
A typical pipeline includes agents or collectors, ingestion services, a message broker, processing workers, indexed storage, dashboards, and alerting.
The design must handle high ingestion volumes, retention policies, query latency, and sudden spikes during incidents.
A useful interview answer distinguishes metrics, logs, and distributed traces and explains how each helps engineers investigate production failures.
28. How would you design a payment processing system?
A payment system must manage payment initiation, authorization, confirmation, refunds, reconciliation, and external provider communication.
A robust design uses durable transaction records, idempotency keys, explicit payment states, audit logs, and careful handling of timeouts.
If a payment request times out, the application must not assume that the payment failed. The provider may have processed it even though the response never arrived.
The system should reconcile uncertain outcomes using provider status queries or webhooks and prevent duplicate charges through appropriate idempotency mechanisms.
Security, regulatory requirements, and sensitive-data handling are essential parts of this design.
Part 5: Advanced System Design Questions
Senior-level interviews often move beyond basic architecture and ask candidates to reason about failure, scale, and competing requirements.
29. How would you design a globally distributed application?
A globally distributed application serves users across multiple geographic regions.
Potential components include regional application clusters, global traffic routing, replicated data stores, CDNs, and regional monitoring.
The main challenges are cross-region latency, data consistency, failover, disaster recovery, and regulatory data residency requirements.
You must decide which data can be replicated asynchronously and which operations require stronger coordination.
A multi-region design is not automatically more reliable. It also introduces additional failure modes and operational complexity.
30. How would you handle a sudden tenfold increase in traffic?
First, determine which component is becoming saturated.
Investigate request rates, CPU, memory, connection pools, queue depth, database utilization, and latency percentiles.
Possible responses include:
- Scaling application instances horizontally.
- Enabling caching for suitable read-heavy requests.
- Applying rate limits.
- Moving nonessential work to asynchronous queues.
- Reducing expensive operations.
- Protecting databases from excessive concurrent queries.
- Activating a tested degraded-service mode.
The important interview lesson is that adding more application servers may not help if the database is already the bottleneck.
You should identify the limiting resource before proposing a scaling strategy.
31. How would you design a highly available system?
High availability requires minimizing both the likelihood of failure and the time needed to recover from it.
A design may use redundant application instances, health checks, replicated storage, automated failover, multiple availability zones, and tested recovery procedures.
You should also discuss monitoring, deployment safety, backup restoration, and dependency failures.
High availability does not mean that failures never occur. It means that the system is designed to tolerate certain failures and recover within defined objectives.
32. What is the difference between RTO and RPO?
RTO stands for Recovery Time Objective. It defines the target time within which a service should be restored after a disruption.
RPO stands for Recovery Point Objective. It defines the maximum acceptable amount of data loss measured in time.
For example, an application might have an RTO of 60 minutes and an RPO of 5 minutes.
This means the recovery plan targets restoring service within an hour and limiting data loss to approximately the last five minutes of updates.
These objectives influence replication, backup frequency, failover design, and operational cost.
33. How would you design a distributed job scheduler?
A distributed job scheduler coordinates tasks across multiple workers or machines.
Its components may include a scheduler, durable job storage, a queue, worker pools, lease management, retry policies, and execution monitoring.
Important challenges include duplicate execution, worker crashes, job timeouts, scheduling fairness, and coordinating jobs that must not run simultaneously.
A strong answer explains how jobs are claimed, how abandoned work is recovered, and how the system prevents retries from creating duplicate business effects.
34. How would you design a system that requires exactly-once processing?
Exactly-once processing is a difficult concept in distributed systems because messages, network responses, and worker executions can fail independently.
Many systems achieve effectively-once business outcomes through a combination of durable records, idempotent operations, unique event identifiers, deduplication, and transactional boundaries.
For example, a payment service may record an idempotency key and return the original result when the same request is submitted again.
You should distinguish between exactly-once delivery, exactly-once processing within a specific transaction boundary, and exactly-once business effects. They are not interchangeable.
35. How would you design a system that remains secure while scaling?
Security must be part of the architecture rather than an afterthought.
A scalable secure system may include:
- Centralized identity and access management.
- Least-privilege service permissions.
- Encryption in transit and at rest.
- Secret management.
- Network segmentation.
- Rate limiting and abuse detection.
- Auditable administrative operations.
- Security monitoring and incident response.
- Regular dependency updates and vulnerability scanning.
You should also discuss how the system handles compromised credentials, malicious clients, data leaks, and failures in security dependencies.
The strongest answers show how security controls fit into normal application workflows without making the system unnecessarily difficult to operate.
Part 6: How to Answer a System Design Interview Question
Knowing the terminology is not enough. Interviewers want to see how you approach an unfamiliar problem.
Use the following framework when designing a system.
Step 1: Clarify the requirements
Start by asking questions about the intended behavior.
For a chat application, clarify whether the system needs group chats, message history, read receipts, file attachments, offline delivery, and end-to-end encryption.
Separate functional requirements from nonfunctional requirements.
Step 2: Estimate scale
Make reasonable assumptions about:
- Daily active users.
- Requests per second.
- Read-to-write ratio.
- Data storage requirements.
- Average payload size.
- Geographic distribution.
You do not need perfect estimates. The objective is to establish an approximate scale that guides architectural choices.
Step 3: Define the APIs and data model
Explain how clients interact with the system and identify the core entities.
For a URL shortener, you might define an endpoint to create a short URL and another endpoint to redirect using a short code.
Then describe the database fields and any relevant uniqueness constraints.
Step 4: Draw the high-level architecture
Start with the main components:
Client → Load Balancer → Application Service → Cache → Database
Add message queues, object storage, CDNs, or additional services only when justified by the requirements.
A simple architecture that satisfies the requirements is better than an unnecessarily complicated design.
Step 5: Identify bottlenecks and failure modes
Ask yourself what happens when:
- Traffic grows tenfold.
- A database node fails.
- A cache becomes unavailable.
- A message is delivered twice.
- A network connection times out.
- A deployment introduces a bug.
Discuss the most important failure modes and explain how the design responds.
Step 6: Explain trade-offs
Every architecture involves trade-offs.
For example, caching can improve response times but introduce stale data. Synchronous communication can simplify workflows but create tight runtime dependencies. Asynchronous processing improves decoupling but makes eventual completion and duplicate handling more important.
Strong candidates explain why a particular choice is appropriate for the stated requirements.
Common System Design Interview Mistakes
Even experienced developers can struggle with system design interviews when they focus too much on technology choices and not enough on the problem itself.
Avoid these common mistakes:
Starting with tools instead of requirements. Do not immediately declare that you will use Kafka, Redis, Kubernetes, and microservices. Explain the problem first.
Ignoring data consistency. If several services modify the same business entity, describe how you maintain correctness.
Designing for enormous scale without evidence. Not every application requires a distributed database or dozens of services.
Ignoring security. Authentication, authorization, rate limiting, secret management, and abuse prevention should be considered where relevant.
Forgetting failure scenarios. Explain what happens when dependencies fail or messages are processed more than once.
Failing to communicate. System design is collaborative. State your assumptions, explain your decisions, and invite feedback.
A 7-Day System Design Interview Preparation Plan
If you have one week to prepare, use the following schedule as a starting point.
| Day | Focus | Practice question |
|---|---|---|
| Day 1 | Architecture fundamentals | Monolith vs. microservices |
| Day 2 | Databases and consistency | Design a scalable database layer |
| Day 3 | Caching and queues | Design a rate limiter |
| Day 4 | URL and file systems | Design a URL shortener |
| Day 5 | Real-time systems | Design a chat application |
| Day 6 | Reliability and security | Design a highly available payment system |
| Day 7 | Mock interviews | Design a video streaming platform |
For each question, spend time clarifying requirements, drawing an architecture, identifying bottlenecks, and explaining trade-offs.
Practicing aloud is particularly useful because interviews evaluate your reasoning and communication, not just the final architecture.
Conclusion
System design is one of the most valuable skills for software engineers who want to progress beyond implementing individual features and begin making architectural decisions.
The ability to design scalable APIs, choose suitable databases, reason about distributed systems, manage failures, and incorporate security is essential for building reliable production software.
The 35 questions in this guide cover the foundations and several real-world challenges you may encounter in technical interviews. However, memorizing answers is not the goal.
The real objective is to develop a repeatable way of thinking about systems: understand the requirements, identify constraints, design a practical architecture, analyze failure modes, and justify your decisions.
Start with small systems such as a URL shortener or rate limiter. Gradually move toward distributed messaging, payment processing, global applications, and high-availability architectures.
Over time, you will begin to recognize the same principles appearing in different systems.
Great engineers write code that works. Great system designers understand why it works, where it will fail, and how to make it scale.
If your goal is to become a senior engineer, software architect, or future CTO, mastering system design is a worthwhile investment in your technical career.
