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 the CAP theorem, in simple words?
The CAP theorem says that when a network partition splits a distributed system, it must choose between consistency (every read sees the latest write or gets an error) and availability (every request gets a non-error response, possibly stale). Partitions can't be ruled out, so the real choice is CP or AP during a partition.
IntermediateIn-depth4 min read - In CAP, why is partition tolerance not really a choice?
Network partitions happen in any real distributed system, so you cannot opt out of P. The real decision is what to do during a partition: refuse some requests to stay consistent (CP) or answer with possibly stale data (AP).
IntermediateQuick answer1 min read - What is the difference between synchronous and asynchronous replication?
Synchronous replication makes the leader wait for replicas to confirm before acknowledging a write, so no acknowledged write is lost but writes are slower. Asynchronous replies immediately and replicates later, which is faster but can lose recent writes.
IntermediateQuick answer1 min read