In short
- Limit the promise first. Name what works offline before you draw any boxes.
- Give every local record an owner, and keep pending intent separate from confirmed server state.
- Accept a write in a local transaction, then let a runner deliver it.
- Use stable operation IDs so an uncertain retry returns the recorded outcome.
- Finish each of the 8 steps with a check you can state out loud, and name each injected failure with the observation that proves recovery.
The user edits a reading-list item on a flight. Their other phone edits the same item before the first phone reconnects.
Which edit survives? What does either screen show while the devices disagree? What happens if the first phone reconnects, sends its change and loses the response?
A mobile system design interview becomes useful when the diagram can answer those questions. Boxes labelled API, cache and database are a start. They need contracts and failure behaviour.
This walkthrough designs an offline-first reading list for iOS and Android. It is an original interview exercise with explicit assumptions, not a claim about a named employer's process. Practise the 8 steps in order, say the check at the end of each step out loud, and only then move on. Use it to rehearse a 45-minute design discussion, then adapt it to your actual round.
Spend the round on the parts that can fail
The prompt for the whole exercise is the following. Design an account-backed app where users save articles, edit a short note and read their list offline. Changes sync across devices.
| Minutes | Steps | Output |
|---|---|---|
| 0 to 5 | 1 and 2, clarify and requirements | User-visible guarantees |
| 5 to 12 | 3 and 4, data model and API | Local and server responsibilities, the mutation contract |
| 12 to 22 | 5, storage | Atomic local acceptance and the read path |
| 22 to 35 | 6, sync | Recovery and concurrency rules |
| 35 to 40 | 7, security | Account boundary, secrets and versions |
| 40 to 45 | 8, observability | Failure tests, metrics and remaining risks |
Follow the interviewer's priorities in a real session. For the full 45-minute framework behind this timing, read the mobile system design interview framework.
1. Clarify what the app promises
Ask what “read offline” includes. In this exercise it means saved metadata and notes, not automatic downloading of every linked webpage or image. Full content downloads would need their own storage, permissions and transfer policies.
Ask for expected list size, edit frequency, offline duration and media volume. If the interviewer provides no figures, make bounded assumptions and label them. Assume a list can contain thousands of items and a returning device may have several days of changes to reconcile. That motivates paginated local reads and incremental sync. It does not, by itself, justify building a global event-streaming platform on the whiteboard.
Check. Say in 1 sentence what the user can do with no connection, and in 1 sentence what you are leaving out.
2. Turn the promise into requirements
Agree on 4 behaviours.
- A local edit appears immediately after it is durably accepted on the device.
- The screen distinguishes pending changes, confirmed changes and conflicts.
- Offline devices can submit changes later, within a defined supported offline window.
- Concurrent edits to the same note are surfaced for resolution rather than silently merged.
There is no real-time co-editing, shared-team list or payments feature. The first version supports 1 user's devices. These choices keep the problem tractable while leaving meaningful consistency work to discuss. The non-functional requirements follow from the behaviours. Local reads must not wait for the network, a lost response must not lose or duplicate an edit, and an old app version must not corrupt newer data.
Check. Each requirement can fail visibly in a test. If you cannot name the test, the requirement is a wish.
3. Give the data model a way to describe uncertainty
The server owns the accepted account state and versions. The local database holds the last confirmed snapshot, pending intent and sync metadata. The screen renders a projection, which is the confirmed snapshot with the pending operations applied on top.
| Record | Important fields | Purpose |
|---|---|---|
| Confirmed item | Account ID, item ID, article ID, note, server version | Last accepted server snapshot |
| Pending operation | Operation ID, item ID, mutation, base version, local sequence | Durable intent that still needs reconciliation |
| Sync checkpoint | Account ID, opaque server token | Position in the change feed |
| Conflict | Local attempted value, current server value and version | Preserves the information needed for resolution |
| Deletion marker | Item ID, server version | Allows other devices to learn about a deletion |
Use a client-generated stable item ID for offline creation, within a protocol that scopes IDs and authorisation to the account. Do not use row position as identity.
A pending local note can differ from the confirmed snapshot without either value being an accidental second source of truth, because they represent different things. The projection must make the difference visible. Treat sync state as data. A spinner alone cannot tell you whether an edit was accepted, attempted, rejected or never sent.
Check. For any item on screen, you can say which record the visible value came from and whether the server has seen it.
4. Define the API as contracts
A proposed mutation contract follows. It is a logical protocol example, not an existing endpoint in Interview Runtime.
{
"operationId": "op-immutable-across-retries",
"itemId": "client-generated-stable-id",
"baseVersion": "server-version-17",
"mutation": { "setNote": "Read chapter three" }
}The server authenticates and authorises the request, recognises duplicate operation IDs within its documented scope, checks the version and applies an accepted mutation with a new version.
For a known operation ID, deduplication must take precedence over rejecting the already-applied operation's old base version. Repeating an accepted request should return its recorded outcome, not turn its success into an apparent conflict. The protocol must also reject reuse of an operation ID with a different payload. Otherwise a client bug can make the retry identity ambiguous.
The read side is a change feed. The client sends its checkpoint token and receives a page of changes and deletions plus the next token. Define an explicit checkpoint-expired response, because the server will not keep history forever.
Version the operation format and define how unsupported mutations are handled. A pending operation can outlive the binary that created it, so a local schema migration must preserve its meaning or move it into an explicit recoverable state. Use capability checks or a server contract to roll out new mutations safely. A remote flag can stop new use, but it does not erase operations already persisted on devices.
Check. You can say what the server returns for a repeated operation ID, for a reused ID with a different payload and for an expired checkpoint.
5. Choose storage and accept writes locally
Choose 1 store per platform and say why. On Android, use Room, which sits on SQLite and can run a block of reads and writes as 1 transaction.[8] On iOS, use Core Data with the pending operation as an entity next to the item, put the related writes through 1 save of the same context and prove with a failure test that a failed save leaves none of them behind. SwiftData is the newer option on the same foundation. Choose it only if your minimum OS version supports it and your team has shipped with it. The rule that matters on both platforms is that the confirmed rows, the pending operations and the checkpoint can be written in 1 atomic step.
When the app opens, render the local projection first. If nothing is stored, show a meaningful initial-loading or offline-empty state. “No saved items” and “we have never loaded your list” are different claims.
For a note edit, persist the pending operation in 1 local transaction and recompute the projection, then acknowledge local acceptance to the UI. A local edit writes the pending operation only. It does not touch the confirmed snapshot, because the server has not accepted anything yet. If storage fails, report that the edit has not been safely saved.
For simplicity, allow at most 1 transmitted mutation per item at a time. Later local edits remain visible as queued intent. When the earlier operation is reconciled, prepare the successor against the appropriate confirmed version. You may coalesce changes that have never been attempted if doing so preserves the required user intent. This sequencing reduces same-device ordering problems. It does not prevent another device from editing the item.
Android's offline-first guidance describes a local-data-driven approach.[1] The same separation works on iOS with its own persistence and execution tools. Platform choices do not establish the protocol's consistency guarantees.
Check. Kill the process after the local transaction. On restart the edit is still visible and still pending.
6. Sync, recover and resolve conflicts
The sync runner does 2 jobs. It sends pending operations, and it pulls changes after the saved checkpoint.
Pull changes without losing a page
Apply each response page's rows and advance the checkpoint in 1 database transaction. A crash then leaves both applied or neither, and the server simply returns the same page again for the old token. If the rows and the token cannot share a transaction, for example because they live in different stores, apply the rows first, advance the token second and make applying a page idempotent. Upsert by item ID, and ignore an incoming version that is not newer than the stored one. Never advance the token first, because a crash then skips changes for good.
Do not blindly replace local pending intent with an incoming server snapshot. Update the confirmed layer, then recompute the visible projection or expose a conflict according to the policy.
If the server forgets an old checkpoint, the client performs a full resync after the expired response. Preserve pending intent separately while rebuilding the confirmed snapshot. Erasing the database and hoping to reconstruct unsent edits is not recovery. This also gives the supported offline window a concrete meaning, because clients need a safe path after the server's retention period.
Recover when the response is lost
Consider the exact sequence.
- The client persists operation A.
- The server applies A and records its outcome.
- The response is lost.
- The process dies before local acknowledgement.
- The restarted client finds A pending.
Retry A with the same identity and payload. Under the agreed contract, the server returns the recorded outcome. Persist the acknowledgement locally without discarding any newer queued intent. Describe this as at-least-once submission with server-side deduplication under stated conditions. A mobile queue does not create an unconditional exactly-once guarantee.
If deduplication retention has expired, you need a reconciliation rule before resubmitting an uncertain old operation as if it were new. An operation-status query, a safe desired-state operation or a documented expiry response may help. If the design cannot distinguish “never applied” from “applied and forgotten”, say so. That is a protocol limit to resolve with the backend team.
Resolve conflicts without deleting a user's work
Both devices edited note version 17. The first accepted write creates version 18. The second write using base version 17 receives a conflict carrying, or allowing retrieval of, the current value and version.
Preserve the local note and the server note, then ask the user to choose or combine them. A resolution is a new mutation against the current version with a new operation ID. Do not change the rejected request's payload and retry it with its old identity. Do not use the device's wall clock to declare that 1 user action was definitely later across devices. This policy trades friction for protection against silent loss. For a simple read or unread flag, another policy may be acceptable, so state the product consequence before choosing a merge strategy.
Deletion needs a policy too. Use tombstones or another server change representation so offline devices can learn that an item was deleted, and define whether editing a deleted item restores it, creates a new item or produces a conflict. If deletion history is compacted, tie that retention to checkpoint expiry and full resync. Otherwise an old offline device may reintroduce data the system intended to remove.
Run the queue when background time is scarce
The outbox is durable intent. A coroutine, Swift task or scheduler request is an opportunity to process it. If the app dies between committing intent and scheduling work, a later reconciliation point must discover pending operations. Foreground startup or resume is 1 such point. Additional background opportunities can improve delivery, but product guarantees must acknowledge their limits. Use bounded batches and record progress between them. On interruption, restart from durable state rather than from an in-memory “syncing” flag. The platforms differ in how they schedule that work, as the table later in this article shows.
Check. You can walk the lost-response sequence above without notes and say which step is covered by which stored record.
If you want to practise this step under a changed requirement, each platform has a guided route in iOS Interview Training and Android Interview Training.
7. Treat security and accounts as a boundary
Namespace local records, checkpoints and pending operations by account. On sign-out, stop the old account's runner and invalidate its ability to commit further results. A late response must not write into the next account's view or storage namespace.
Choose whether unsynced data is retained securely for the same account, exported or removed after an explicit user decision. Do not silently send it under a different identity.
Authenticate every mutation on the server, and scope item IDs, operation IDs and checkpoints to the account. Keep credentials in the platform's secure storage. That is the Keychain on iOS, and on Android a non-exportable key in the Android Keystore that encrypts the stored token, because the Keystore holds keys rather than the token itself.[4][5] Logs should carry diagnostic operation identifiers and failure categories without recording private notes or credentials.
For a Staff discussion, explain who owns the protocol, how iOS and Android test it and how the backend changes are sequenced. “Both platforms share an interface” is not enough if their retry semantics differ. Senior versus staff mobile interviews covers how that expectation changes between levels.
Check. You can say what happens to a response that arrives after sign-out, and where the token lives on each platform.
8. Observe the system and verify histories
| Injected failure | Required observation |
|---|---|
| Process dies after local transaction | Intent remains available after restart |
| Process dies before scheduling | Later reconciliation discovers pending work |
| Server applies request, response is lost | Retry reconciles the same operation |
| New local edit precedes old acknowledgement | New intent remains visible and pending |
| 2 devices edit 1 version | Conflict preserves both relevant values |
| Checkpoint expires | Confirmed state rebuilds without losing pending intent |
| Account changes during a response | Old response cannot affect the new account |
Measure pending-operation age, conflict frequency, permanent rejections and time to visible local content. Split metrics by app version and platform. A low HTTP error rate can coexist with edits that never leave the device. Use the same operation identifier and failure categories on iOS and Android, so a report from either platform can be matched against the other.
Check. For each failure in the table you can name the metric or the test that would show it, not only the fix.
What differs between iOS and Android
The design is the same on both platforms. The platform facts underneath it are not.
| Concern | iOS | Android |
|---|---|---|
| Local persistence | Core Data, or SQLite through a library. Keep the related writes in 1 save and test that a failed save leaves none of them | Room on SQLite. A transaction block commits together[8] |
| Background execution | BGTaskScheduler refresh and processing tasks that the system runs when it chooses, and background URLSession transfers[3] | WorkManager persistent work with constraints and retry policy, kept across restarts and reboots[2] |
| Process death and termination | The system can terminate a suspended app without running your code, so relaunch starts from storage. After a force quit, do not count on background wake-ups until the user opens the app again, because the system discards a held background notification when the app is force quit[6] | The system can kill a background process at any time. The screen restores from saved state, and queued WorkManager work persists |
| Secure storage | Keychain | Android Keystore key that encrypts the token |
| Push wake-ups | A silent notification is a low-priority, best-effort hint that the system can throttle[6] | A high-priority message can wake the device for limited processing, and delivery can still be delayed or missing[7] |
Avoid promising identical wake-up timing across platforms. The platforms differ in when the work runs, not in what the outbox means. Because no wake-up is guaranteed, startup and resume stay the dependable reconciliation points on both.
For a deeper treatment of the Android side, read Android offline sync at staff level. If your round also covers structure, modularisation in mobile architecture interviews is the neighbouring topic.
Practise the explanation under a changed requirement
Close the article and describe what happens when the process dies immediately after the server accepts an edit. Then change 1 assumption. The item is now shared between users, or the server no longer retains duplicate outcomes for as long.
Identify which contract changed and what the existing design can no longer promise. That is more useful practice than drawing the same boxes again.
The Mobile Bundle covers both platforms for $169. Or read the free sample for iOS Interview Training or Android Interview Training before buying.
Sources
- Android Developers, build an offline-first app.
- Android Developers, persistent background work with WorkManager.
- Apple, choosing background strategies for your app.
- Android Developers, Android Keystore system.
- Apple, Keychain services.
- Apple, pushing background updates to your app.
- Firebase, setting the priority of a message.
- Android Developers, accessing data using Room DAOs.
Questions readers ask
© 2026 Mike Salari, Interview Runtime. All rights reserved. Quoting a short excerpt with a link to this page is welcome; republishing the article, in full or in part, is not.



