System Design · Middle · Question 25 of 75
How would you build offline mode for a notes app?
- ✓Correct answer: Service Worker for the shell, IndexedDB for data and a sync queue for changes
- 2Store notes in cookies so they're sent to the server automatically
- 3Disable the app without a network and show an error page
Explanation
Offline-first: the shell comes from the SW cache, data is read and written locally, changes accumulate in a queue and are sent when the network returns (Background Sync or on the online event). Conflict resolution needs to be thought through.