InterviewStack.io LogoInterviewStack.io

Data Consistency and Distributed Transactions Questions

Maintaining correctness of state across services and replicas: eventual consistency, conflict resolution (last-write-wins, CRDTs, vector clocks), the saga pattern, two-phase commit, and idempotency keys for exactly-once effects. Covers when to trade strict consistency for availability and how to reason about read-your-writes and monotonic guarantees. Focuses on the application/service layer rather than storage-engine internals.

MediumTechnical
33 practiced

Compare two-phase commit (2PC) and the saga pattern as approaches to coordinating a transaction that spans multiple services. Explain how each handles atomicity, availability, and isolation, and describe the kinds of business workflows where sagas are preferred over 2PC (and vice versa).

HardSystem Design
32 practiced

Design a CRDT-based multi-master replication scheme for user-profile objects replicated across regions. Which CRDT types would you choose for the different kinds of profile fields (counters, strings/text, sets), how would you handle deletions and tombstones, and how would you surface an unresolved semantic conflict to the application when a CRDT merge alone can't decide the right outcome?

HardSystem Design
34 practiced

Describe a zero-downtime migration strategy to change a service's consistency model from strong to eventual. Include feature flags, dual-writes, read-path toggles, monitoring to verify correctness, and a rollback path if anomalies appear. Explain how you would validate data correctness throughout the migration.

HardTechnical
36 practiced

Describe an algorithmic approach to reconcile diverged replicas for a key-value store that uses last-writer-wins (LWW) with version vectors. Account for missing timestamps, partial updates, tombstones, and the goal of preserving monotonicity when possible. Explain operational steps an SRE should take to run reconciliation safely.

MediumSystem Design
35 practiced

Design a scalable approach to support atomic increments for a counter that's sharded across many keys (for example, a global 'likes' count). Compare a few approaches (per-shard counters with periodic aggregation, CRDT counters, a central counter service, optimistic CAS-based increments) on accuracy, throughput, read latency, and reconciliation cost.

Unlock Full Question Bank

Get access to all Data Consistency and Distributed Transactions interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.