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
34 practiced
Design monitoring and alerting to detect consistency anomalies such as replication lag, diverging replicas, stale reads, or unexpected conflict rates. Specify metrics, synthetic checks (dual reads, canaries), sampling frequency, thresholds tied to SLOs, and an on-call triage playbook for high-severity alerts.
MediumTechnical
35 practiced
Implement an idempotent HTTP consumer endpoint in Python (Flask or similar). The endpoint receives JSON payloads with a unique 'message_id' and arbitrary 'payload'. Use Redis (assume available) as a durable deduplication store to ensure each message_id is processed exactly once even under concurrent deliveries. Show how you handle races, expiry, and crash recovery.
HardSystem Design
30 practiced
Design a safe process to change a schema that introduces new cross-row invariants (for example, adding a unique constraint that spans rows stored on different shards). Explain migration steps, backward compatibility strategies, data migration patterns, dual-writes, and SRE checks to ensure data correctness during rollout.
MediumTechnical
27 practiced
Explain three-phase commit (3PC) and how it extends 2PC. Describe the pre-commit, prepare, and commit phases, why 3PC can be non-blocking under certain assumptions, and why it is rarely used in practice. Include operational concerns an SRE should know about if a team wants to implement 3PC.
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.

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.