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.

HardSystem Design
28 practiced

How can you implement multi-entity transactional updates in a NoSQL store that lacks distributed transactions while aiming for serializability or strong consistency? Describe practical patterns: entity ownership (single-writer), per-entity locks, application-level two-phase commit with idempotent steps, and consensus-backed coordinators, and compare complexity and failure modes for each.

HardSystem Design
32 practiced

An application needs strongly consistent (linearizable) behavior for some operations and can tolerate eventual consistency for others within the same system. How would you design the APIs and data partitioning so clients can choose the right consistency level per operation, without causing data corruption or excessive complexity?

HardSystem Design
30 practiced

Architect a cross-service transactional system for moving money between accounts managed by separate services. Requirements: atomic transfer semantics (debit and credit both commit, or the system compensates), a durable audit trail, and the ability to reconcile and prove conservation of funds. You cannot use a single distributed database. Propose an architecture (saga, 2PC, or a hybrid), specify the protocol steps, failure handling, idempotency guarantees, and reconciliation process.

HardSystem Design
33 practiced

An enterprise needs eventual consistency between service A and service B using events. Design an idempotent event processing and reconciliation strategy that guarantees convergence and supports replays, while preserving ordering where necessary.

HardTechnical
56 practiced

Explain why two-phase commit (2PC) can block indefinitely and why three-phase commit (3PC) is rarely used in practice despite being designed to fix that. What non-blocking alternatives exist for cross-shard transactions, and how do they compare on safety, liveness, performance, and operational complexity?

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.