Distributed systems
CAP Theorem
CAP says a distributed data system cannot simultaneously guarantee consistency and availability while the network between nodes is partitioned. When a split happens, the operator must choose which one the system gives up.
In technical terms
Formally (Brewer/Gilbert-Lynch): during a network partition, every read/write is either consistent (some nodes must refuse or block) or available (some answers may be stale). Partition tolerance is not optional. Wide-area networks partition, so the real choice each operation makes is C or A. Modern databases are per-operation tunable, not globally CP or AP.
Why it appears in interviews
Interviewers ask it as the vocabulary test for consistency conversations; the grade is the precision: candidates who recite “pick two of three” signal memorization, those who say “during a partition, block or serve stale” signal understanding.
The common misconception
Two standard errors: “pick 2 of 3 always.” With no partition, C and A are both achievable; and CAP’s C meaning ACID transactional consistency. It is linearizability across replicas, a different concept with the same letter.
Trade-offs & when it hurts
CP systems (etcd, ZooKeeper, quorum writes) refuse service when a majority is unreachable. Right for locks, config, membership. AP systems (Cassandra/Dynamo family with tunable quorums) keep serving possibly-stale reads. Right for catalogs and feeds. The senior answer names which door each of your data paths walks through and what the failover UX looks like.
How to show it in an interview
Skip the memorized definition and apply the theorem in one pass: “When our partition isolates half the cluster, the lock service refuses writes (no quorum, no lease); the catalog serves stale. A five-second-late price is a support ticket, a dead page is revenue.” That paragraph is the whole grade.
Questions this concept earns
- Pick one service you have worked on: CP or AP during a partition, and prove why.
- What is your error budget when the majority side cannot be reached: a hard failure, or queued writes?
- How would you detect the system serving A where the schema actually required C?
Use the concept in a real session
Answer follow-up questions about cap theorem and related systems, and get a scored report in minutes.
Related
Last reviewed: 2026-09-03 by MockWise Engineering · Corrections welcome via contact.