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.

EasyTechnical
34 practiced

Explain session guarantees: read-your-writes, monotonic reads, monotonic writes, and write-follows-reads. Propose an implementation strategy for a client SDK to provide these guarantees against a multi-region replicated datastore, including how you'd persist the necessary metadata across devices and handle token expiry.

MediumTechnical
28 practiced

Implement a VectorClock class in Python that supports: increment(node_id), merge(other_clock), and compare(other_clock) returning one of {'less', 'greater', 'concurrent', 'equal'}. Provide function signatures, brief inline comments, and an example of using compare to detect concurrent updates between two replicas.

EasyTechnical
33 practiced

Define Conflict-free Replicated Data Types (CRDTs) and explain the difference between state-based (CvRDT) and operation-based (CmRDT) CRDTs. Walk through how a couple of common CRDT types merge, and give two realistic use cases where you'd recommend them.

HardTechnical
32 practiced

Implement a PN-Counter (Positive-Negative counter) CRDT in Python with methods: increment(amount), decrement(amount), merge(other), and value(). Provide the data structure and explain why merge is commutative, associative, and idempotent.

HardSystem Design
32 practiced

Design a saga coordinator that supports long-running transactions which include human approvals and manual compensations. Describe the state machine, durable state storage, visibility for operators, timeout and escalation policies, and how to ensure auditability and idempotent retries of compensating steps.

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.