Android Performance & Memory Interview Questions
Jank, leaks, profiling, and startup speed.
50 questions in this topic · 8 sample questions below
Practice Performance & Memory in the quiz engine
Sample questions
Which thread must not perform long-running blocking work in an Android app?
Why: The main thread handles UI and input, so blocking it causes jank and ANRs; heavy work belongs on background threads. Background workers exist precisely to run such work, and developers do not schedule work on GC or internal vsync threads.
What does the term jank refer to in Android UI performance?
Why: Jank is the visible stutter when frames are dropped or rendered late, missing the frame budget. It is unrelated to APK size, memory leaks, or network timeouts.
Which library is commonly used specifically to detect memory leaks in debug builds?
Why: LeakCanary automatically watches for retained objects and reports leak traces in debug builds. Retrofit handles networking, Glide loads images, and WorkManager schedules background work, none of which detect leaks.
What is a cold start?
Why: A cold start begins with no existing process, so the system must create it and initialize the Application and first Activity. If the process already exists it is a warm or hot start, which is faster.
Which color format uses more memory per pixel for a bitmap?
Why: ARGB_8888 uses 4 bytes per pixel, more than RGB_565's 2 bytes, because it stores full color plus alpha. Thinking RGB_565 uses more reverses their actual sizes.
Which statement about a memory leak in an Android app is accurate?
Why: Leaked objects stay reachable so the GC cannot reclaim them, gradually shrinking usable heap until an OOM may occur; the app often runs fine for a while. It does not crash instantly, and the GC cannot collect still-reachable objects.
Why does holding a static reference to an Activity or its Context commonly cause a leak?
Why: A static field lives for the process lifetime, so referencing an Activity keeps it and its views from being collected after onDestroy. Static references are strong, not weak, and Activity Contexts are the classic leak source precisely because they are so large.
Why is a non-static inner-class Handler that posts delayed messages a classic leak risk?
Why: A non-static inner class implicitly references its enclosing Activity, and a pending message in the MessageQueue references the Handler, keeping the Activity reachable past destruction. The issue is the implicit outer reference, not native memory or background threads.
Practice all 50 Performance & Memory questions
These 8 are a sample. The full Performance & Memory 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 Android Framework interview questions
- Android Kotlin Multiplatform interview questions
- Android WorkManager & Background interview questions