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 →
- 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