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

MediumTechnical
57 practiced
Describe the transactional outbox pattern and explain why it helps achieve consistency between a service's database and its messaging system. Provide the sequence of steps (application transaction, outbox insert, poller publish, mark-published), explain failure modes (crash between commit and publish), and compare with CDC-based approaches (Debezium) including pros and cons.
MediumSystem Design
29 practiced
Design a distributed transaction mechanism for a booking system that spans payment and reservation services. Requirements: avoid double-booking, ensure atomic transfer where both steps commit or the system compensates, support retries, and produce audit logs. Compare two-phase commit and saga patterns, pick one with justification, and outline coordinator behavior, timeouts, and recovery procedures.
HardSystem Design
28 practiced
Architect a multi-region analytics ingestion pipeline that must replicate writes from any of three regions to a central analytics store within 5 seconds and must avoid data loss. Detail ingestion buffers, cross-region replication strategies (fan-in via durable queues, CDC tailing), ordering and deduplication approaches, backpressure handling, and how you will monitor SLA compliance and test under region failure.
HardSystem Design
30 practiced
Architect a cross-service transactional system for moving money between accounts managed by separate services. Requirements: atomic transfer semantics (debit+credit or compensated rollback), durable audit trail for regulation, and ability to reconcile and prove conservation of funds. You cannot use a single distributed database. Propose an architecture (saga, 2PC, or hybrid), specify protocol steps, failure handling, idempotency guarantees, and reconciliation processes.
MediumTechnical
39 practiced
Explain how Kafka's transactional API and idempotent producers work together to achieve exactly-once semantics for producer→Kafka→consumer cycles. Cover transactional.id configuration, producer fencing, transaction begin/commit/abort, consumer read_committed mode, and limitations when integrating transactional writes with external datastores.

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.