Data Consistency and Distributed Transactions Questions

Maintaining correctness of state across services and replicas: eventual consistency, conflict resolution (last-write-wins, CRDTs, vector clocks), the saga pattern, two-phase commit, and idempotency keys for exactly-once effects. Covers when to trade strict consistency for availability and how to reason about read-your-writes and monotonic guarantees. Focuses on the application/service layer rather than storage-engine internals.

MediumTechnical
31 practiced

Design a mechanism to provide 'read-your-writes' consistency to end users when reads are served through API proxies, caches, or CDNs. What approaches could you use, and what are the latency, cache-hit-rate, and availability trade-offs between them?

HardSystem 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: users see their own updates immediately (read-your-writes) within a region, other users see updates eventually (within a bounded window), and 99th-percentile read latency stays low per region. Sketch the high-level architecture, replication strategy, and how you provide the read-your-writes guarantee without strong global coordination.

MediumTechnical
39 practiced

A dedup store holds per-event idempotency keys to enforce exactly-once for a streaming sink. Propose a safe garbage-collection strategy that reclaims keys without risking re-accepting late-arriving or retried events incorrectly. Include TTL calculation relative to watermarks, watermark alignment across nodes, and mechanisms to coordinate GC in a distributed deployment.

EasyTechnical
28 practiced

Explain the two-phase commit (2PC) protocol in detail: the coordinator and participant roles, the prepare and commit phases, and how durable logs are used to survive a crash. Enumerate the key failure modes (coordinator crash, participant crash, network partition) and describe the typical participant responses to each.

MediumTechnical
27 practiced

Implement a Last-Write-Wins (LWW) merge function for a replicated key-value store in your preferred language (Python or Java). Inputs: two versions of a value each with a timestamp and node id. Return the resolved value and explain how you handle timestamp ties and clock skew. Discuss drawbacks of LWW when applied to counters or sets.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.