Design Offline-First Data Sync for a Field Rep Mobile CRM
Last updated: November 29, 2026
Quick Overview
Design how a tablet CRM app used by pharmaceutical field reps keeps accounts, call plans, sample inventory and call reports available offline and syncs changes with the server reliably when connectivity returns.
Veeva Systems
November 29, 20260
0
0 solved
Design how a tablet CRM app used by pharmaceutical field reps keeps accounts, call plans, sample inventory and call reports available offline and syncs changes with the server reliably when connectivity returns.
Reps visit hospitals and clinics with weak signal, so Vault CRM's iPad and mobile apps must work fully offline and sync later without losing compliance-critical data such as signed sample receipts. The interviewer checks incremental sync design, conflict handling, and how data is scoped to what each rep is allowed to see.
What the Interviewer Expects
- Scopes device data to the rep's territory and permissions rather than syncing everything
- Uses incremental sync with server change tokens instead of full refreshes
- Queues local writes with client-generated ids and idempotent upload
- Defines conflict policy per object type (field merge, server wins, reject after submit)
- Handles security: encrypted local store, remote wipe, data removed when territory changes
- Estimates data size and sync frequency
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- A rep's territory is realigned overnight and loses 300 accounts; what happens on the device?
- How do you guarantee a signed sample disbursement is never lost or double counted?
- How do you handle schema changes when a device has not synced for two weeks across a release?
- How would you measure sync health across 50,000 devices?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: browse accounts and HCPs in territory, plan and record calls, capture sample signatures, send approved email drafts, all offline. Sync both directions when online. Non-functional: no lost ...
High-Level Design
Device: SQLite store mirroring a subset of server objects, an outbound queue of mutations, and a sync engine. Server: a sync API that, per user, computes the visible set from territory alignment and s...