Software Engineer Interview Question

Explain the CAP theorem and how it applied to a system you have worked on.

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

CAP says that when a network partition splits your nodes, you must choose between consistency and availability. You cannot opt out of partition tolerance, because networks fail whether you plan for it or not. So the real question is what your system does during a partition: refuse writes to stay correct, or accept them and reconcile later. Outside a partition you can have both, which is why latency is the everyday trade.

Why interviewers ask this

Interviewers use CAP to separate people who memorized three letters from people who have run distributed systems. The signal is understanding that partition tolerance is not optional, that the choice only bites during a partition, and that day to day you are really trading latency against consistency. A concrete example of picking one side for a specific feature is what makes the answer credible.

How to structure your answer

  • State that partition tolerance is a given, not a choice.
  • Frame the real choice as behavior during a partition.
  • Note that outside partitions you trade latency, not availability.
  • Give a feature where you picked each side.

Example answer

Spoken example, first person

The framing I use is that partition tolerance is not a choice, because packets get dropped and switches fail regardless of my architecture. So CAP is really asking what the system does while it is split: refuse the write so nobody reads stale data, or take the write and sort it out afterwards. What I like about the PACELC extension is that it names the part you deal with every day, which is that even when everything is healthy you are trading latency against consistency, because a quorum write across regions costs round trips. On a product I worked on we split it by feature. Anything touching billing went through the primary with a read after write guarantee, because charging somebody twice is not recoverable with an apology. The activity feed read from replicas and could be a few seconds behind, and nobody ever noticed. Same system, two answers, chosen per feature rather than as an architectural religion.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • What does PACELC add to CAP?
  • How would you give a user read after write consistency on replicas?
  • What does a quorum read and write actually guarantee?

Related software engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot