Mobile System Architecture and Offline-First Design Questions
Architecting the mobile side of a distributed system: client-server sync, offline-first storage and conflict resolution, background processing, push notifications, and modular mobile architecture at scale. Covers syncing state across intermittent connectivity and designing backends for millions of mobile clients. The mobile-specific slice of distributed design.
Design an eventual-consistency and conflict-resolution strategy for hierarchical data (folders and notes) on mobile where users can concurrently move, rename, and edit items offline. Requirements: preserve structural invariants (no cycles), allow concurrent operations, provide intuitive conflict UX, and describe server reconciliation and tombstone/GC policies.
For a mobile e-commerce checkout flow, analyze trade-offs between implementing strong consistency (server-side reservation or locks at checkout) versus eventual consistency (optimistic checkout with later reconciliation). Propose a hybrid approach that minimizes user friction, reduces oversell risk, and supports offline shopping scenarios.
Explain vector clocks and Lamport (logical) clocks. Provide a short example demonstrating how vector clocks can detect concurrent updates across two devices, and explain a case where a Lamport clock would be insufficient for conflict detection in mobile sync scenarios.
Implement an exponential backoff reconnection function in Kotlin with full jitter. Signature:
fun nextBackoff(attempt: Int, baseMillis: Long = 500, maxMillis: Long = 60000): Long
Requirements: use "full jitter" (random between 0 and cap), cap at maxMillis, handle large attempt values safely, and be deterministic enough for tests (allow injection of RNG if needed).
In Kotlin, outline the data structures and pseudocode for a crash-safe, persistent on-device change queue used to capture user operations while offline. Requirements: survive app restarts, support idempotency keys for deduplication, implement exponential backoff for retries, and resume uploads without duplicating work. Show function signatures and key queries/transactions.
Unlock Full Question Bank
Get access to all Mobile System Architecture and Offline-First Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.