Android Android Framework Interview Questions
Lifecycle, intents, services, and platform behavior.
50 questions in this topic · 8 sample questions below
Practice Android Framework in the quiz engine
Sample questions
During a device rotation of a visible, foreground Activity, which sequence of lifecycle callbacks best describes what happens by default?
Why: By default a configuration change destroys and recreates the Activity, so the full teardown then rebuild sequence runs. onConfigurationChanged only fires instead of recreation when you declare that config in android:configChanges, which is not the default.
A user presses the Back button to finish an Activity, versus the system killing your app's process while it is in the background. Which statement is correct about onSaveInstanceState state?
Why: A user-initiated finish (Back) is treated as permanent, so saved state is intentionally dropped, whereas process death for resource reasons preserves the saved Bundle for restoration. Claiming state survives a Back-press is the common misconception.
What is the primary risk of putting a large bitmap or list into the Bundle passed to onSaveInstanceState?
Why: onSaveInstanceState data is marshalled across Binder, whose transaction buffer is limited (about 1MB shared per process), so oversized state throws TransactionTooLargeException. It is not silently truncated, which is why large objects belong in a ViewModel instead.
Which mechanism survives a configuration change but is intentionally cleared when the Activity is truly finishing?
Why: A ViewModel is retained across configuration changes via the ViewModelStore and its onCleared runs only when the owner is permanently finishing. The onSaveInstanceState Bundle also survives rotation but is designed for small state and also survives process death, so it is a different tool.
An Activity is declared with launchMode singleTask and is already at the root of a task in the background. A new Intent targets it again. What happens?
Why: singleTask keeps a single instance at the task root; a re-launch clears anything above it and delivers the Intent via onNewIntent. The idea that singleTask creates a new task on every launch is a frequent misconception; it reuses the existing instance.
On Android 12 and above, if you create a PendingIntent without specifying a mutability flag, what happens?
Why: Starting with Android 12 (API 31), constructing a PendingIntent requires explicitly passing FLAG_IMMUTABLE or FLAG_MUTABLE, otherwise it throws. Assuming it silently defaults to mutable is exactly the insecure assumption the change was made to prevent.
Which pair of Activity lifecycle callbacks is correctly matched as counterparts?
Why: The visible lifetime is bounded by onStart/onStop and the foreground lifetime by onResume/onPause. Pairing onStart with onPause mixes the visible and foreground boundaries and is incorrect.
What is the fundamental reason onDestroy cannot be relied upon for critical persistence such as saving user data?
Why: Under memory pressure the OS may terminate the process outright, so onDestroy is not guaranteed to execute; durable saves belong in onPause or onStop. Believing onDestroy is always called before the process dies is the classic mistake.
Practice all 50 Android Framework questions
These 8 are a sample. The full Android Framework 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 Security 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 Kotlin Multiplatform interview questions
- Android WorkManager & Background interview questions
- Android Performance & Memory interview questions