As asked
Design offline support for a React Native field app where users create inspections without network access and sync them later. How do you handle conflicts and retries?
Sample answer outline
Use a local durable store such as SQLite or WatermelonDB for inspection records and an outbox table for pending mutations. Each mutation needs an idempotency key so retries after app restarts or flaky networks do not duplicate server state. Conflict handling depends on domain rules: last-write-wins is rarely acceptable for inspections, so prefer field-level merge, server validation, or explicit user resolution. Sync should be resumable, ordered where required, and observable through local status per record. Weak answers hide conflict resolution behind a generic queue and never define the server contract.
Expect these follow-ups
- How do you sync attached photos without exhausting device storage?
- What does the server need to store for idempotency?
- How do you test a week of offline edits?