Sanjaay Gowda T S
Apple Inc. practice

ORIGINAL COMPANY-CONTEXT PRACTICE

Reconcile edits from offline devices

Software engineeringHardConcept

Original practice scenario: Design a hypothetical notes application for an Apple-like device ecosystem. Two offline devices edit and delete the same note before reconnecting. What state must sync preserve?

Written for independent practice using company context; this is not a verified question from a company interview.

A REASONED APPROACH

Model answer.

Preserve operation identity and causal information instead of using wall-clock timestamps as unquestioned truth. Offline synchronization must distinguish a genuine deletion from an unseen edit.

Work through it

  1. Give notes and operations stable identifiers; retain a version vector or another explicit causal marker for changes acknowledged by each device.
  2. Define conflict behavior by field: merge independent edits where meaningful, expose concurrent incompatible changes, and retain deletion markers until safe collection.
  3. Make applying an operation idempotent, reconcile in different arrival orders, and test reconnects after long offline intervals or device restoration.

Tradeoffs to discuss

  • Automatic merging reduces interruptions but can surprise users; visible conflict versions consume storage and require understandable recovery controls.

Common pitfalls

  • A newly restored device must not resurrect a deletion merely because its local clock is ahead.
  • Do not erase conflict evidence before all relevant replicas can learn the final state.

KEEP PRACTISING

Related questions.

Keep learning beyond the interview.

Explore the Learning Hub