InterviewStack.io LogoInterviewStack.io

Client Caching and Offline Persistence Questions

Client side caching and local data persistence strategies for applications, including in memory caches, disk based caches, and mobile platform storage options. Cover offline first design patterns where apps remain usable without network connectivity, synchronization and conflict resolution protocols for syncing local changes back to servers, eventual consistency and freshness trade offs, schema migrations and versioning for local stores, pagination and handling large data sets under device constraints, and platform specific considerations such as iOS (UserDefaults, Core Data, Realm, NSCache) and Android (SharedPreferences, SQLite, Room, Realm). Also include strategies for synchronizing state across views and components, background sync, and strategies to minimize data loss and reduce sync conflicts.

MediumTechnical
82 practiced
Explain how you would implement background sync on Android to upload local changes reliably. Cover the important APIs (WorkManager, JobScheduler, AlarmManager), handling constraints (battery, network type), retry and backoff strategies, doze mode, and testing. Include how you'd ensure work isn't duplicated and how to chain dependent tasks.
HardTechnical
70 practiced
How would you minimize user data loss when an app is uninstalled and later reinstalled? Discuss approaches such as server-side backups tied to user accounts, cloud device backups (iCloud/Android Auto Backup), keychain/keystore behaviors across backups, and secure recovery flows. Include privacy and legal considerations (consent, data retention).
EasyTechnical
88 practiced
How would you securely persist sensitive items such as OAuth tokens or encryption keys on Android and iOS? Discuss platform APIs (iOS Keychain, Secure Enclave, Android Keystore / EncryptedSharedPreferences), best practices for key derivation and storage, and considerations for backups and restore.
EasyTechnical
86 practiced
Describe TTL (time-to-live) and staleness strategies for client caches. Explain when to favor client-driven TTL, server-driven invalidation, or conditional requests (ETag/If-None-Match). Include how you'd expose staleness to UI (e.g., stale-while-revalidate) and how offline apps surface freshness to users.
HardTechnical
116 practiced
You must implement conflict resolution for complex domain objects edited offline across multiple devices. Provide a decision framework for choosing between Last-Writer-Wins (LWW), automatic domain-aware merges, CRDTs, and user-driven resolution. Then outline sample merge pseudocode for merging a 'document' that contains text, tags (set), and a list of attachments.

Unlock Full Question Bank

Get access to hundreds of Client Caching and Offline Persistence interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.