How would you add offline support to an app that currently only works online?
What the interviewer wants to hear
- Local database as the source of truth (Room, SwiftData, SQLite)
- Repository syncs between network and local store
- Queue writes made offline and send them later with background work
- Handle conflicts and failed syncs
- Show users sync status and stale data clearly
Model answer
I would move to an offline-first design. First I add a local database such as Room on Android or SwiftData on iOS, and make it the single source of truth: the UI observes the database, not the API. A repository fetches from the network when possible and writes results into the database, so screens update automatically. For writes, I save the change locally right away, mark it as pending, and put it in a sync queue. A background job, like WorkManager or BGTaskScheduler, sends pending changes when the network is back, with retries. On the server side I need version numbers to detect conflicts and a clear merge rule. In the UI I show when data was last updated and which items are not synced yet.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Mobile App Developer questions
- Users say a list in your app stutters while scrolling. How would you find and fix the problem?
- Walk me through how you release a new version of a mobile app to the stores.
- What is dependency injection and how have you used it in a mobile app?
- What security practices do you follow when building a mobile app?
- How do you manage state in a Flutter or React Native app as it grows beyond a few screens?
- What testing strategy do you use for a mobile app, and what do you test at each level?
- How would you implement deep links in a mobile app from end to end?
- How do you make a mobile app accessible, and how do you check it?
- How would you set up CI/CD for a mobile app?