01 — Requirements
“Design an application that works offline and syncs when connectivity returns.”
02 — API & Data Model
Define the sync protocol and storage schema.
03 — Architecture
Map the offline-first data flow: local store sync queue conflict resolver remote server.
04 — Cache Strategy
Choose between cache-first, network-first, and stale-while-revalidate approaches.
05 — Service Worker Lifecycle
Understand install wait activate redundant state machine.
06 — IndexedDB Schema
Design object stores for documents, sync queue, and cache metadata.
07 — Offline Queue
Queue mutations while offline and drain them on reconnect.
08 — Sync Engine
Step through the sync algorithm: dequeue send confirm advance.
09 — Conflict Detection
Detect conflicts using vector clocks when two devices edit the same item.
10 — Conflict Resolution
Choose a strategy: last-write-wins, field-level merge, or manual resolution.
11 — Optimistic UI
Show changes instantly and roll back on sync failure.
12 — Background Sync
Retry failed syncs with exponential backoff using the Background Sync API.
13 — Cache Invalidation
Version cached assets and invalidate stale entries on deploy.
14 — Storage Quota
Monitor storage usage and evict least-recently-used entries under pressure.
15 — Network Status
Detect online/offline/slow transitions and adapt UI behavior accordingly.