The interview problem

Practice prompt

Two jobs update overlapping partitions of a table stored as immutable files. Design a commit protocol that avoids exposing half a job or silently losing another writer.

Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.

1. Scope and worked approach

Assume an authoritative transaction log with a conditional publication primitive. A writer reads table version v, records its read/write dependencies, creates immutable output files and validates conflicts before attempting version v+1. Readers select a committed snapshot manifest rather than listing arbitrary new files. Losing a commit race triggers conflict revalidation; it does not justify blindly publishing the same update against a new base.

2. Trace the design or derivation

Read snapshot
  → stage files
  → validate dependencies
  → conditionally commit
  → refresh readers

Give each logical job a transaction identity and reconcile the log after an ambiguous publication timeout. A successful commit with a lost response must not be replayed as a second append. Staged-file cleanup should wait beyond the longest supported commit-reconciliation window and verify no committed manifest references the files.

3. Calculate the example

Jobs A and B both read balance partition version 10. A adds five to a value of 20 and publishes 25. B subtracts three using its old read and proposes 17. Publishing B unchanged would lose A's update; recomputing against the valid new snapshot yields 22 if the business operation permits a retry. Disjoint append jobs may need different conflict rules.

4. Failure cases and trade-offs

Orphan output files need delayed garbage collection, not immediate deletion that races uncertain commit outcomes. File-level conflict checks can be conservative. Broad partition rewrites increase conflicts; finer granularity improves concurrency but complicates validation. Schema and protocol changes also participate in correctness.

5. Validation, follow-ups and self-review

Inject concurrent append/update, publication timeout and reader refresh. Verify snapshot atomicity and operation-aware retries. Follow-up: when can abandoned files be reclaimed? Reward an authoritative commit point and explicit read-dependency validation.

Sources and related practice

Technical reference: docs.delta.io — Optimistic table concurrency and conflicting operations.

Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.

Continue with Design a cross-shard transaction coordinator; Reclaim unreferenced blobs safely.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.