Skip to interview prep
Apexed

20. Explain the CAP theorem.

HardSystem design

Technical
Show model answer

During a network partition, a distributed data store must choose between consistency (every read sees the latest write) and availability (every request gets a non-error response). Partition tolerance is not optional in real networks.

So systems lean CP (reject some requests to stay consistent) or AP (stay available and reconcile later). PACELC adds that even without partitions you trade latency against consistency.

Explain the CAP theorem. — Software engineering interview question — Apexed