InterviewStack.io LogoInterviewStack.io

Data Consistency and Distributed Transactions Questions

In depth focus on data consistency models and practical approaches to maintaining correctness across distributed components. Covers strong consistency models including linearizability and serializability, causal consistency, eventual consistency, and the implications of each for replication, latency, and user experience. Discusses CAP theorem implications for consistency choices, idempotency, exactly once and at least once semantics, concurrency control and isolation levels, handling race conditions and conflict resolution, and concrete patterns for coordinating updates across services such as two phase commit, three phase commit, and the saga pattern with compensating transactions. Also includes operational challenges like retries, timeouts, ordering, clocks and monotonic timestamps, trade offs between throughput and consistency, and when eventual consistency is acceptable versus when strong consistency is required for correctness (for example financial systems versus social feeds).

HardTechnical
38 practiced
Design an algorithm to compact vector clocks or CRDT deltas in a long-running distributed system to avoid unbounded metadata growth while preserving eventual convergence. Discuss safe heuristics (time-based eviction, snapshotting), trade-offs in losing precise causality, and strategies to recover or reconcile after compaction.
HardSystem Design
56 practiced
Explain why two-phase commit (2PC) can block and why three-phase commit (3PC) is rarely used in practice. Present non-blocking alternatives for cross-shard transactions such as consensus-backed commit (running 2PC on top of Paxos/Raft), optimistic concurrency with conflict resolution and multi-version timestamp ordering. Compare safety, liveness, performance, and operational complexity.
MediumTechnical
35 practiced
Design a monotonic timestamp system across distributed services that supports causal ordering. Compare synchronized wall-clock timestamps (NTP), Lamport clocks, and Hybrid Logical Clocks (HLC). For each approach explain how it addresses ordering, clock skew, and operational deployment trade-offs for backend systems.
EasyTechnical
28 practiced
Describe what idempotency means for HTTP APIs and why it's important for backend reliability. For a POST /payments endpoint implemented in Node.js with PostgreSQL, outline at least two practical strategies to implement idempotency keys (for example, storing keys in Redis with TTL or unique DB constraints), include TTL/cleanup considerations, and explain how to handle concurrent duplicate requests.
HardTechnical
38 practiced
Design an automated test harness to validate saga compensating transactions under network partitions, process crashes, and message duplication. Define test scenarios to simulate, invariants to validate (for example, funds conserved), how to inject faults deterministically and repeatedly, and the reporting required to reproduce failing scenarios.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.

40+ Data Consistency and Distributed Transactions Interview Questions & Answers (2026) | InterviewStack.io