intermediate 2 min answer

A mobile app syncs data in the background every 15 minutes. Users report data is frequently out of date. Explain.

mobileos-constraintssync
Show the full answer Hide the answer

What the interviewer is testing

Whether you know that mobile operating systems control background execution, and that scheduling is a request rather than a guarantee.

The explanation

The app does not control its own execution. Both major platforms defer, batch or refuse background work based on battery state, network conditions, thermal state, and — critically — how recently the user opened the app.

An app the user opens rarely gets progressively fewer opportunities to run. So the 15-minute schedule is a hint, and for infrequent users the actual interval may be hours or effectively never.

Low power mode, background restrictions and aggressive vendor-specific battery management on some Android devices make it worse and vary by manufacturer.

The design consequences

Treat background sync as opportunistic and unpredictable. Never assume a background task completed.

Reconcile on foreground. The moment the user opens the app, sync — this is the reliable opportunity and it should be fast enough to be invisible.

Use push for anything time-critical, and understand that push delivery is best-effort too: it can be delayed or dropped, so it should be treated as a hint to sync rather than as data delivery. A push carrying the payload and no reconciliation path will silently lose updates.

Batch into infrequent larger operations rather than frequent small ones, which is both what the OS rewards and what preserves battery.

Make every background operation resumable and idempotent, because it will be killed mid-execution routinely.

The user experience fix

Show data freshness in the interface. Displaying stale data as current is the actual complaint; a timestamp and a manual refresh affordance resolves most of it honestly, and costs nothing.

What a strong answer adds

The rule for anything that genuinely must happen — a payment confirmation, a safety alert: the server owns the outcome and the device is a notification target, not the executor. Systems that put the critical step on the device discover the gap in the field, unevenly, and blame the network.

Common weak answers

Reducing the sync interval, which the OS ignores. Adding a foreground service, which drains battery and is restricted.