System Design 28 interview questions0/28 questions known−
1. Scaling basics−
QVertical vs horizontal scaling?Vertical scaling (scale up): a bigger machine, more CPU, RAM or faster disks.
QWhat does a load balancer do? Which algorithms are common?A load balancer spreads requests across healthy servers, runs health checks to remove dead ones, and often terminates TLS.
QWhat is a CDN and how does it work?A Content Delivery Network is a set of edge servers around the world that cache content close to users.
QHow do you design for high availability? What is a single point of failure?A single point of failure (SPOF) is any component whose failure takes the whole system down: one DB, one load balancer, one region, even…
QHow do you do back-of-the-envelope estimation?Estimate scale to justify design choices; round aggressively and state assumptions.
2. Caching−
QExplain caching strategies: cache-aside, write-through, write-back.- Cache-aside (lazy loading): the app reads the cache; on a miss it reads the DB and fills the cache.
QHow do cache eviction and invalidation work? Where can you cache?Eviction decides what to drop when the cache is full: - LRU (least recently used): the usual default - LFU (least frequently used): keeps…
3. Data at scale−
QHow does database replication work? What are read replicas?Leader-follower (primary-replica): all writes go to the leader, which streams its change log to followers.
QWhat is sharding? How do you choose a shard key?Sharding (horizontal partitioning) splits one table's rows across several databases, so each holds a subset.
QWhat is consistent hashing and why is it used?With naive hash(key) % N, changing the number of servers N remaps almost every key, which empties a cache or forces a huge data migration.
QSQL vs NoSQL: how do you choose?SQL (Postgres, MySQL): fixed schema, joins, ACID transactions, powerful ad-hoc queries.
QHow do you generate unique IDs in a distributed system? Explain Snowflake.Options: - DB auto-increment: simple but a bottleneck and SPOF; leaks counts - UUID v4: no coordination, but 128 bits, random, so poor…
4. Consistency−
QExplain the CAP theorem and PACELC.CAP: in a distributed data store, when a network partition happens you must choose between: - Consistency: every read sees the latest write…
QStrong vs eventual consistency, and models in between?- Strong (linearizable): once a write succeeds, every reader sees it.
QHow do you handle transactions across microservices? What is a saga?Each service owns its database, so one ACID transaction is impossible.
QWhat is idempotency, and how should clients retry failed requests?An operation is idempotent if doing it twice has the same effect as once.
5. Architecture−
QMicroservices vs monolith?Monolith: one deployable.
QWhat is an API gateway?A single entry point in front of many backend services.
QWhy use a message queue? Kafka vs RabbitMQ? Queue vs pub/sub?Queues decouple producers from consumers: absorb traffic spikes, do slow work asynchronously (emails, video encoding), retry failures, and…
QWhat is event-driven architecture?Services communicate by publishing events ("OrderPlaced") to a broker, and other services subscribe and react, instead of calling each…
QWebSockets vs Server-Sent Events vs long polling?- Short polling: the client asks every few seconds.
QWhat are the common rate limiting algorithms?- Fixed window counter: count per minute bucket.
QWhat are the three pillars of observability?- Logs: discrete events with context.
6. Design problems−
QDesign a URL shortener (like bit.ly).Requirements: shorten a URL, redirect fast, optional custom alias and expiry, analytics.
QDesign a distributed rate limiter.Requirements: limit per user/IP/API key (e.g.
QDesign a chat application (like WhatsApp).Requirements: 1:1 and group chat, online presence, delivered/read receipts, message history, offline delivery, low latency.
QDesign a news feed (like Twitter/Instagram home timeline).Requirements: post content, follow users, see a feed of followed users' posts, newest or ranked, fast loads (under 200ms).
QDesign a notification system (push, email, SMS).Requirements: send via push (APNs/FCM), email and SMS; respect user preferences and quiet hours; templates; scheduling; at-least-once…
Scroll to zoom · drag to move · click a node to open it · double-click to zoom in