# System Design Interview Prep: CAP Theorem

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/blog/cap-theorem
Source observed: 2026-11-05T00:52:48.331Z
Last checked: 2026-11-05T00:52:48.331+00:00
Indexed: 2026-11-06T17:13:10.584+00:00

---

# System Design Interview Prep: CAP Theorem

**Aced (formerly Exponent)** — Technical Program Management

Kevin Jin • Last updated a month ago

This article is part of our system-design series. Our [System Design Interview Course](https://www.aced.io/courses/system-design-interviews?utm_source=blog&utm_campaign=blog-banner&src=blog) provides additional preparation resources.

## Partition tolerance and the theorem

CAP stands for **Consistency**, **Availability**, and **Partition tolerance**. A network partition is a temporary network failure between nodes. Partition tolerance means keeping nodes in a distributed database running despite network partitions.

The theorem says that, during a network partition, a distributed database can ensure **consistency or availability**. Network partitions cannot simply be excluded from the design because they occur in real systems.

## Example: two nodes in a multi-master architecture

In a [multi-master architecture](https://en.wikipedia.org/wiki/Multi-master_replication?ref=exponent-blog.ghost.io), data can be written to multiple nodes. Suppose a database has Node A and Node B. When Node A receives a write, it synchronizes the update with Node B, so reads from either node return the updated value.

![Two-node multi-master database example](https://storage.ghost.io/c/a5/f5/a5f5c2f0-4c62-43c7-891b-662a0b6d68b3/content/images/F464jnC7iMvb2ysV_OzEhioVRRQVC6kZAp517IxBpUHXcASGG0zu-r-FYQhApgoC8MgaNcxr-BvZjDhFB_uWjuo1zBhgnPjC11hB52rKctERhBCBwvJVgKYQPJpUWRD4eqNzAztF.png)

If a partition separates the nodes, updates cannot synchronize. Each node is unaware of what the other received. The response to a write depends on whether the database prioritizes consistency or availability.

## Consistency

Consistency means that after a write, reads sent to any node return the updated data. During the partition in the example, both Node A and Node B reject writes. Their states remain identical rather than allowing one node to hold newer data and the other to hold stale data.

![Consistency behavior during a partition](https://storage.ghost.io/c/a5/f5/a5f5c2f0-4c62-43c7-891b-662a0b6d68b3/content/images/k6t5KLy-Y9gn4SIo6QfQhAA2n-HDWlyPpR4DdjaUG5AzMdkz77q48Bt1ckpeGtPNQt5qyiRvJcNQRKrVCLWzQByZZujxwzMFCzy99c8KzBp979QGu06b7hwYqNFf2iQVvjCbWJTe.png)

## Availability

An availability-prioritizing database allows requests to complete even when node data is temporarily inconsistent. One node can contain stale data while another has the newest value. After the partition is resolved, the nodes eventually synchronize; the timing is not predetermined.

![Availability behavior during a partition](https://storage.ghost.io/c/a5/f5/a5f5c2f0-4c62-43c7-891b-662a0b6d68b3/content/images/NlWg_70zAUOM6U9uUpPdlHXdcZzzxfe-NsDBGLnQkYGd3VwfhwwuCSb-XnzyXMhj8LZRXgqggQMsDBtkRxpbH_XRveJX_JDLGNjumRwq2XphJm_KcYnlrMcVpje3jtFp0bPnIz0k.png)

## Choosing consistency or availability

Prioritize consistency when data must be current. Prioritize availability when slightly stale query results are acceptable and completing requests matters more.

### Read requests

Reads do not change database state or require nodes to resynchronize. They are typically acceptable during partitions in both consistency- and availability-focused databases.

## SQL databases

MySQL, PostgreSQL, Microsoft SQL Server, and Oracle usually prioritize consistency. [Master-slave replication](https://en.wikipedia.org/wiki/Replication_(computing)?ref=exponent-blog.ghost.io#DATABASE) is common. If the master becomes unavailable, a replica becomes the new master. During failover and master election, writes are paused to preserve consistency.

## Popular databases that prioritize consistency versus availability

![Popular databases that prioritize consistency versus availability](https://storage.ghost.io/c/a5/f5/a5f5c2f0-4c62-43c7-891b-662a0b6d68b3/content/images/pmlesson/2021/04/image.png)

## Does CAP consistency mean strong consistency?

Strong consistency means that an immediate read after a write always returns the updated data. Perfect strong consistency is not possible in a distributed system because communication between physically separated nodes takes more than zero time. In practice, databases described as prioritizing consistency generally have eventual consistency with a very short, usually unnoticeable, lag between nodes.

## Why “choose two of three” is incorrect

The phrase “choose two of Consistency, Availability, or Partition Tolerance” is incorrect. During a partition, the choice is whether to prioritize consistency or availability. Partition tolerance cannot be forfeited; a system that is not partition tolerant would become unresponsive during network failures and would not be available either.

## Short exercises

### Question 1

You are building a product-listing application similar to Amazon’s. Shoppers can browse products and purchase them if they are in stock. You want to avoid selling an item that is unavailable and then refunding a shopper. Should the database prioritize consistency or availability?

**Answer: Consistency.** If nodes cannot synchronize, it is preferable to reject purchases and writes rather than let multiple shoppers buy the same last item on different nodes. An availability-focused database could permit that situation, requiring at least one order to be canceled and refunded.

### Question 2

The same product-listing application has determined that refunding shoppers for unavailable items is more cost-effective than showing products as out of stock during a network failure. Should the database still prioritize consistency or availability?

**Answer: Availability.** Canceling and refunding an order is preferable to preventing all shoppers from purchasing during the network failure.

## Interview preparation and coaching

- [Browse technical program manager interview questions](https://www.aced.io/questions?role=tpm&src=blog) and answers from real candidates.
- [Book time with a Technical Program Manager coach](https://www.aced.io/coaching?role=tpm). Coaching includes mock interviews, career coaching, and resume review. [Browse coaches](https://www.aced.io/coaching?role=tpm&src=blog).

We offer free interview guides, insider tips, and courses through Aced. [Create your free account](https://www.aced.io/signup?src=blog).

## Related courses

### [Software Engineering Interview Prep Course](https://www.aced.io/courses/software-engineering)

5 courses • 41,700 students. Prepare for roles at Google, Amazon, Microsoft, Meta, Apple, and other companies with mock interviews, frameworks, and advice from senior candidates. Practice data structures, algorithms, system design, people management, behavioral interviews, and more.

### [Technical Program Management Interview Prep Course](https://www.aced.io/courses/tpm)

5 courses • 18,700 students. Prepare for program-management roles at Google, Meta, Amazon, Microsoft, Apple, and other companies. Practice system design, program sense, cross-functional projects, behavioral interviews, and more.

## Related blog posts

- [Technical Program Manager Interview Prep (2026 Guide)](https://www.aced.io/blog/how-to-ace-the-technical-program-management-interview) — A month ago • 28 min read
- [What TPM Interviewees Need to Know About Cross-Functional Partnerships](https://www.aced.io/blog/what-tpm-interviewees-need-to-know-about-cross-functional-partnerships) — A month ago • 11 min read
- [How to Answer System Design Questions like “Design Twitter.”](https://www.aced.io/blog/how-to-answer-system-design-questions-like-design-twitter) — A month ago • 9 min read
- [What is System Design in Technical Program Management?](https://www.aced.io/blog/what-is-system-design-in-technical-program-management) — A month ago • 9 min read

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fblog%2Fcap-theorem&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fblog%2Fcap-theorem). Opening a form does not execute a tool.