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.

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?

MediumTechnical
35 practiced

Discuss the trade-offs between throughput and consistency when designing a service that requires high write throughput. What metrics would you collect to quantify the trade-off, and what patterns let you move some operations to eventual consistency while preserving correctness on the critical paths?

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.

MediumTechnical
27 practiced

Implement a Last-Write-Wins (LWW) merge function for a replicated key-value store in your preferred language (Python or Java). Inputs: two versions of a value each with a timestamp and node id. Return the resolved value and explain how you handle timestamp ties and clock skew. Discuss drawbacks of LWW when applied to counters or sets.

MediumTechnical
31 practiced

Outline a design for handling partial commits when a distributed transaction fails mid-way: detection, compensating actions, operator alerts, automated reconciliation, and the runbook steps a support team should follow.

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.