Question presented to candidate: "What is the difference between strong consistency and eventual consistency? How does each one actually get implemented, what does the user notice, and how would you decide which one a feature needs?"
What a strong answer should cover:
- Strong (linearizable): once a write completes, every later read anywhere returns it; the system behaves like one copy
- Eventual: if writes stop, all replicas converge to the same value; until then a read may return any older value, with no bound on how old
- How each is built: a leader with synchronous replication, consensus or majority quorums for strong; asynchronous replication, read-any-replica and anti-entropy for eventual
- The visible anomalies of eventual consistency: stale reads, not seeing your own write, values going backwards in time between reads
- The middle ground: read-your-writes, monotonic reads, causal, bounded staleness, and how a session token or sticky routing provides them cheaply
- The cost side: strong consistency adds latency (waiting for replicas) and loses availability during partitions; eventual is fast and available but pushes complexity to the application
Clarifying questions expected:
- Which reads must reflect the latest write (money, inventory, permissions) and which can be a little old (feeds, counters)?
- Are replicas in one region or spread across regions (what does a synchronous round trip cost)?
Code / implementation expected: Optional β a model of a leader and lagging followers that measures stale reads and shows read-your-writes and monotonic-reads fixes; the example does that.