Interview Q&A / System Design
System Design interview questions
Caching, scaling, databases and classic design problems for beginners.
Prefer rapid revision? Practise System Design short interview answers →
- What is a dead letter queue and when do you use one?
A dead letter queue holds messages that failed processing after the allowed retries. It stops one bad message from blocking the queue forever and keeps the message for inspection and later reprocessing.
BeginnerQuick answer1 min read - What is the difference between a message queue and publish-subscribe?
In a queue each message is processed by exactly one consumer from a group, which shares the work. In pub-sub each message is delivered to every subscriber, so many services can react to the same event.
BeginnerQuick answer1 min read - How do you make a message consumer idempotent?
Record the id of each processed message in the same transaction as its effect, and skip ids already seen. Or design the operation to be naturally repeatable, such as setting a value rather than incrementing it.
IntermediateQuick answer1 min read - How does Kafka keep messages in order, and what role do partitions play?
Kafka guarantees order only within a single partition. Messages with the same key go to the same partition, so ordering holds per key. More partitions give more parallelism but no global order.
IntermediateQuick answer1 min read - What does at-least-once delivery mean, and can you get exactly-once?
At-least-once means a message is never lost but may be delivered more than once. True exactly-once delivery is not practical across a network, so systems use at-least-once plus idempotent consumers to get exactly-once effects.
IntermediateQuick answer1 min read - What is backpressure and how do you handle a queue that keeps growing?
Backpressure means slowing or limiting producers when consumers cannot keep up. For a growing queue, add consumers, make processing faster, reject or throttle new work, and set limits so the queue cannot grow without bound.
IntermediateQuick answer1 min read - What is the transactional outbox pattern and what problem does it solve?
It solves the dual-write problem: updating a database and publishing an event can't be atomic. The outbox writes the event into a table in the same database transaction, and a separate process publishes it to the broker.
AdvancedQuick answer1 min read