ZZomato·BehavioralL3System Design

CAP Theorem Trade-offs

viaGlassdoor

Q: Explain the CAP theorem and where you'd trade consistency for availability (or vice versa). A: CAP theorem states a distributed system can only guarantee two of three properties during a network partition: Consistency (every read gets the most recent write), Availability (every request gets a non-error response), and Partition tolerance (the system continues operating despite network partitions). Since partitions are unavoidable in real distributed systems, the real choice is CP vs AP during a partition. CP systems (e.g., a bank ledger, a leader-based config store like etcd/Zookeeper) refuse requests rather than serve stale/conflicting data. AP systems (e.g., a shopping cart service, a DNS-like lookup, Zomato's restaurant listing cache) prioritize staying responsive even if some nodes serve slightly stale data, reconciling later. Interviewers want you to map the choice to a concrete example, not just recite the theorem.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account