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?
Read 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
Give notes and operations stable identifiers; retain a version vector or another explicit causal marker for changes acknowledged by each device.
Define conflict behavior by field: merge independent edits where meaningful, expose concurrent incompatible changes, and retain deletion markers until safe collection.
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.
Original practice scenario: A hypothetical mobile feature must classify user-selected images locally. How would you choose a smaller model without assuming that average accuracy captures the user experience?
Read model answer +
Evaluate task quality together with latency, memory and energy constraints on representative devices. Local execution changes deployment constraints but does not establish that a model is accurate or private by itself.
Work through it
Create consented or synthetic evaluation data covering lighting, orientation, image quality and important classes; keep a separate held-out set.
Compare candidate models and compression settings on the same cases, recording per-class errors and uncertainty alongside cold and warm inference latency.
Test older supported hardware, thermal throttling, interrupted execution and unsupported inputs; define a fallback or clear inability response.
Tradeoffs to discuss
Quantization or smaller architectures may reduce memory and energy use while disproportionately hurting rare classes.
Common pitfalls
Avoid tuning repeatedly on the final evaluation set.
Ensure diagnostics do not accidentally upload image content merely because inference itself runs on the device.