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
38 practiced

Explain the differences between Lamport clocks, vector clocks, and logical timestamps in general. For each, state what it can and cannot detect (ordering versus true concurrency) and walk through a brief example of how it's updated on send and receive events.

HardTechnical
31 practiced

Design a conflict detection and resolution strategy for a piece of user data that may be updated concurrently at multiple regions (for example, user preferences, or a shopping cart with offline mobile edits). What options would you weigh, and how would you present a merge conflict to the user when automatic resolution isn't confidently correct?

EasyTechnical
32 practiced

For a high-throughput streaming ETL ingesting user events, what metadata would you record to enable efficient deduplication of events within a time window? Explain how fields such as event_id, user_id, event_time, ingestion_time, and partition offsets are used during processing, and the retention implications of keeping that metadata. Then list the common deduplication approaches available (producer-side dedupe, consumer-side dedupe using state, dedupe tables or upserts, watermark/window compaction) and give one advantage and one drawback of each.

HardSystem Design
31 practiced

Design an automated reconciliation pipeline that detects and repairs divergence between an authoritative source of record and its derived read views or replicas (search indexes, caches, a materialized streaming view, or independent downstream systems such as a CRM, payments gateway, and ERP at 100M records/day). Include detection heuristics (checksums, sampling, row counts, LSN alignment, key-level diffs), safe automated repair actions (targeted replays, upserts), audit logging for each repair, safe throttling, human-in-the-loop approval for destructive fixes, and how you'd surface prioritized mismatches for remediation with owner assignment.

MediumSystem Design
38 practiced

Architect a transactional outbox pattern for reliably publishing domain events when committing a write to the primary database. Include the outbox table schema, the reader design (and how you'd compare a polling reader against a change-data-capture-based reader), ordering guarantees, idempotency handling on the consumer side, and how you would scale the reader for high throughput.

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.