Skip to content
RED SAGSkills
hardFrontend Developer interview question

How would you design a web app that keeps working offline, for example for field workers with poor connectivity?

What the interviewer wants to hear

  • Service worker caches the app shell and static assets with suitable strategies
  • Store data locally in IndexedDB and read from it first
  • Queue writes in an outbox and sync them when the connection returns
  • Plan for conflicts: versioning, last-write-wins or server-side merge rules
  • Clear UI for offline and sync status, plus safe app updates

Model answer

I would build it as a PWA. A service worker precaches the app shell and versioned static assets, so the app opens without a network. HTML uses network-first with a cache fallback, while images can use stale-while-revalidate. Data lives in IndexedDB, through a small wrapper such as Dexie, and the UI always reads from the local store, so screens look the same online and offline. Every change is written locally and added to an outbox queue with a unique id. When the connection returns, a sync process sends the queue in order; the ids make retries idempotent. Conflicts are the hard part, so I agree rules with the backend: record versions or timestamps, last-write-wins for simple fields, and a review screen for important clashes. The UI shows clear status: offline banner, pending changes count and sync errors. I also handle storage limits, request persistent storage, and make service worker updates safe so users never lose queued work.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Frontend Developer questions