Home / offline sync architecture iOS interview

Mobile system design

Offline sync architecture iOS interview

Offline-first sync is a favorite senior prompt because it forces you to reason about failure, ordering, and truthfulness under real network conditions.

The core design

Make the local store the source of truth so the UI is always fast and available. Writes go into an outbox queue and are applied locally immediately, then synced to the server in the background with retries and exponential backoff. On reconnect, you replay queued changes and pull remote updates, reconciling the two into local state.

Handling the hard parts

Discuss ordering and idempotency so a retried request cannot double-apply, conflict resolution when the same entity changed on two devices, and a UI that honestly shows pending or failed states rather than pretending a write succeeded. Mention background execution limits and how you resume sync when the app returns to foreground. That honesty about failure is the senior signal.

Go deeper than a summary

Share Your Screen works topics like this through in full: 75 solved Swift problems with tests, 9 real case studies, and 7 annotated mock interviews, so you rehearse the live round instead of just reading about it.

Get the book

Frequently asked

What is the source of truth in offline-first design?

The local store. The UI reads and writes locally for speed and availability, and a background process syncs those changes with the server.

How do you avoid double-applying a retried write?

Make operations idempotent, for example with a client-generated id or version, so replaying a queued change on retry has no additional effect.