Android Security Interview Questions
Secure storage, auth, and hardening.
50 questions in this topic · 8 sample questions below
Practice Security in the quiz engine
Sample questions
What does EncryptedSharedPreferences from Jetpack Security primarily provide over plain SharedPreferences?
Why: EncryptedSharedPreferences encrypts keys and values on disk using AES with a master key held in the Android Keystore. It is not a performance or sync feature, and SharedPreferences is a key-value store, so SQL injection is irrelevant.
Why is storing an API key in BuildConfig or a Gradle field considered insecure?
Why: BuildConfig constants are compiled into the DEX as plaintext string literals and trivially extracted by decompiling or running strings on the APK. They are not encrypted, and any attacker with the APK can read them without root.
What is the correct characterization of ProGuard/R8 in an Android security context?
Why: R8 renames symbols and strips unused code, which raises reverse-engineering effort but leaves the logic and string literals recoverable. It is not encryption and does not remove embedded secrets, which remain in the DEX as plaintext.
What does setUserAuthenticationRequired(true) on a KeyGenParameterSpec enforce for a Keystore key?
Why: The flag binds key use to a recent user authentication, enforced by the secure hardware which authorizes the crypto operation rather than releasing the key. Keystore keys are non-exportable, so no option that copies or exports key material is correct.
What distinguishes a StrongBox-backed Keystore key from a standard hardware-backed one?
Why: StrongBox keys live in a dedicated tamper-resistant hardware security module, giving stronger isolation than a TEE that shares the main processor. If StrongBox is unavailable the request fails rather than silently falling back to software.
What does Android Keystore key attestation let a backend server verify?
Why: Attestation produces a certificate chain, rooted in a Google CA, proving the key lives in hardware and describing its properties. It does not verify subscriptions, decompilation status, or the specific lock screen credential strength.
When using BiometricPrompt with a CryptoObject, what does binding a cipher to the prompt achieve beyond a simple biometric check?
Why: A CryptoObject makes the unlocked Keystore cipher usable only after a genuine biometric match, so an attacker cannot spoof the callback result without the actual crypto authorization. Biometric templates never leave the secure hardware and are not uploaded or stored by the app.
What is the main limitation of client-side root or tamper detection?
Why: Root detection executes inside the app process on a device the attacker fully controls, so its checks can be hooked, patched, or spoofed. It is a speed bump, not a boundary, and does not depend on the OS version or lock screen.
Practice all 50 Security questions
These 8 are a sample. The full Security bank is scored, tracks your progress, and explains every answer.
More Android interview topics
- Android Hilt interview questions
- Android Coroutines & Flow interview questions
- Android Room interview questions
- Android Design Patterns interview questions
- Android Mobile System Design interview questions
- Android Coding Interview Patterns interview questions
- Android NDK interview questions
- Android Sensors interview questions
- Android Jetpack Compose interview questions
- Android Canvas & Animation interview questions
- Android CI/CD interview questions
- Android Git interview questions
- Android Unit Testing interview questions
- Android Kotlin interview questions
- Android Retrofit interview questions
- Android Architecture interview questions
- Android Android Framework interview questions
- Android Kotlin Multiplatform interview questions
- Android WorkManager & Background interview questions
- Android Performance & Memory interview questions