What options do you have for storing data on the device, and how do you choose between them?
What the interviewer wants to hear
- Key-value stores (DataStore, UserDefaults) for small settings
- A database (Room, SwiftData, Core Data, SQLite) for structured, queryable data
- Files for large blobs like images or downloads
- Keychain or Keystore for secrets such as tokens
- Consider size, querying needs, security and migrations
Model answer
I pick storage by the shape and sensitivity of the data. Small settings like theme or onboarding done go in a key-value store: DataStore on Android, UserDefaults on iOS, shared_preferences in Flutter. Structured data that I need to query, sort or observe, like a list of orders, goes in a database such as Room, SwiftData, Core Data or SQLite through a library like Drift. Large blobs like images, PDFs or downloaded media go into files in the app sandbox, often in the cache directory if they can be re-downloaded. Secrets such as refresh tokens go in the Keychain or in storage encrypted with the Android Keystore, never in plain preferences. I also plan for schema migrations from day one and avoid storing more personal data than the feature needs.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy Mobile App Developer questions
- What is the difference between native and cross-platform mobile development? When would you choose each?
- Explain the lifecycle of a mobile app screen. Why does it matter?
- How do you handle network calls and errors in a mobile app?
- What is MVVM and why is it used in mobile apps?
- How do push notifications work in a mobile app?
- How do you run slow work like network calls or database reads in a mobile app without freezing the UI?
- How do you request runtime permissions like camera or location, and what do you do when the user says no?
- How do you make your app look good on different screen sizes, orientations and font sizes?
- What is the difference between declarative UI (Compose, SwiftUI, Flutter, React Native) and the older imperative style?