All jobs / Mobile developer / Networking
Mobile developer interview question · 1–3 years
A notes app edits offline and later meets a server that also changed. What do you do?
The strongest answer
Queue the local mutation, detect the conflict on sync, and give a product rule — merge, last-write, or ask the user — do not silently drop either side
Why it works
Exactly. Offline is a distributed-systems problem. Queue, detect, decide — in the product, not in a coin flip.
What a good answer covers
- Persist a mutation queue.
- Detect server-side versions / etags.
- Have an explicit merge rule.
- Never drop a write silently.
Answers that fall short
- Close, but not the strongest: Last write wins always; conflicts are too rare to show
Rare still loses people’s words. Name the rule. - Weak: Block the UI until they are online so conflicts cannot happen
Forcing online abandons the feature you advertised. - Red flag: Keep both copies in memory and pick at random on next launch
Random is data loss with extra steps.
Who gets asked this
More Networking questions
- How do you avoid re-downloading a list that rarely changes, without showing stale data for ever?
- You are choosing how a field-sales app syncs. What do you put in the design doc?
- On launch the app fires six requests at once. The access token has expired, and some users end up logged out…
- Three apps will all work offline. What do you standardise?
- The API was down for ten minutes. It fell over again the moment it returned, and the traffic was the app…
- The backend adds a field to a response and the shipped app starts failing to parse it. What should the client…
- A feed can be tens of thousands of items. How do you load it?