How would you explain CAP theorem in a system design interview?
Maya Garcia
·688 views
I'm really struggling to explain the CAP theorem clearly and concisely in system design interviews. I understand the concept: you can only pick two of Consistency, Availability, and Partition Tolerance. But when it comes to illustrating it with real-world examples and explaining *when* to choose CP vs AP, I often feel like I'm fumbling or overcomplicating it.
For example, I know a banking system would typically prioritize CP, while a social media feed might lean towards AP. But then I get asked about what happens during a network partition in a CP system (it becomes unavailable) versus an AP system (it might return stale data). I also get stuck on how deep interviewers expect me to go into the nuances. Is a high-level overview sufficient, or do they want me to discuss specific database choices and their CAP properties (e.g., MongoDB, Cassandra, Paxos/Raft-based systems)?
Any tips or a mental framework for nailing this explanation without getting lost in the weeds?
8 comments