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
35 practiced
Explain Conflict-free Replicated Data Types (CRDTs) and how they ensure eventual convergence without coordination. Design a CRDT for per-post like counts in an eventually-consistent social feed: pick a CRDT type (G-counter or PN-counter), describe the merge function, convergence properties, and how you'd handle deletes and metadata compaction.
HardSystem Design
57 practiced
Design a highly-available, sharded idempotency service used by many backend services to deduplicate requests. Specify the API contract, storage model, sharding/partitioning scheme, TTL and GC strategy, how to handle cross-shard duplicate detection, scaling, and key migration implications.
HardSystem Design
34 practiced
Design a hybrid consistency model for a social feed: provide strong consistency for a user's own posts (so they see their posts immediately) and eventual consistency for ranking and like counts. Define API-level guarantees, storage/replication strategies, how to handle fanout (synchronously vs async), and how clients should handle transient inconsistencies.
HardTechnical
31 practiced
Design a mechanism to provide 'read-your-writes' consistency to end users when reads are served from API proxies, caches, or CDNs. Evaluate approaches such as sticky sessions, client-side version tokens, write-through cache invalidation, and directed origin reads, and discuss latency, cache hit-rate, and availability trade-offs.
HardSystem Design
28 practiced
How can you implement multi-entity transactional updates in a NoSQL store that lacks distributed transactions while aiming for serializability or strong consistency? Describe practical patterns: entity ownership (single-writer), per-entity locks, application-level two-phase commit with idempotent steps, and consensus-backed coordinators, and compare complexity and failure modes for each.

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.