DataStore & Preferences

DATA › Storage

Modern key-value persistence: DataStore vs SharedPreferences, commit/apply, encryption, and migration.

Persistence basics show up in almost every Android interview because nearly every app stores user settings. Interviewers probe whether you know why DataStore replaces SharedPreferences, the commit() vs apply() threading trade-off, when to pick Preferences vs Proto DataStore, and how to migrate safely. Expect questions on coroutines/Flow, transactional writes, and the deprecation of EncryptedSharedPreferences.

What this covers

Study this topic

Further reading