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).

MediumSystem Design
38 practiced
Design a saga orchestration for an e-commerce order workflow that touches services: Orders, Payments, Inventory, Shipping. Specify the normal-step flow and compensating actions for failures. Discuss how you ensure idempotency, how you persist saga state, and how you detect and handle partial failures and retries.
MediumSystem Design
29 practiced
Design a multi-region user profile service that must support 100M users, 50k profile updates per second globally, and 1M reads per second. Requirements: (1) users should see their own updates immediately (read-your-writes) within a region, (2) other users can see updates eventually (within 1 minute), (3) 99th-percentile read latency < 50ms per region. Sketch a high-level architecture, replication strategy, and how you would provide the read-your-writes guarantee without strong global coordination.
HardTechnical
36 practiced
Implement (or outline in Java-style pseudocode) a simplified two-phase commit coordinator that persists its state to disk, sends PREPARE to participants, collects votes, and either COMMITs or ABORTs. Include crash-recovery behavior: on restart the coordinator must consult the log and continue to completion. Describe how you avoid duplicate messages and ensure idempotent operations at participants.
MediumTechnical
34 practiced
Describe hybrid logical clocks (HLC) and how they combine physical time with logical counters to produce monotonic timestamps resilient to small clock skew. Explain how HLC can be used to provide causal ordering and why it's preferable over pure physical clocks in some distributed systems.
HardSystem Design
27 practiced
Compare CRDTs and Operational Transformation (OT) approaches for building a collaborative rich-text editor. Discuss convergence guarantees, metadata growth, undo/redo complexity, latency of local edits, and design implications for presence/awareness features.

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.