Battery & Power Interview Questions

PERFORMANCE › Runtime

What are the main things that drain battery in Android apps?

What a strong answer covers: Keeping the radio active with frequent network requests, wake locks that stop the CPU sleeping, frequent or high-accuracy location, sensors left running, background work that runs too often, and heavy CPU use and screen-on time. The cellular radio stays in a high-power state for a while after each request, so many small requests are expensive.

What are Doze and App Standby, and how do they affect background work?

What a strong answer covers: Doze kicks in when the device is stationary, unplugged and the screen is off: network access is suspended, wake locks are ignored, and jobs and alarms are deferred to maintenance windows. App Standby Buckets limit how often apps the user hasn't used recently can run jobs and alarms. Use WorkManager, which respects these, and FCM high-priority messages for urgent wake-ups.

How do you reduce battery cost when an app needs location?

What a strong answer covers: Use the Fused Location Provider with the lowest accuracy and longest interval that works (balanced power rather than high accuracy), stop updates when the screen isn't visible, use batching (maxUpdateDelay), geofencing instead of continuous tracking, passive updates, and only use a foreground service with location when the user is actively doing something like navigation.

How do you batch network work to save battery, and why does it help?

What a strong answer covers: Each request wakes the radio, which then stays in a high-power tail state for seconds. Grouping requests, such as uploading analytics in batches, prefetching data in one go, and using WorkManager with constraints like unmetered or charging for non-urgent syncs, means the radio wakes less often. Also use push messages instead of polling, and caching to avoid requests altogether.

Users complain your app drains battery overnight. How would you investigate?

What a strong answer covers: Check Play vitals for excessive wake-ups, stuck wake locks and background Wi-Fi scans. Reproduce with adb shell dumpsys batterystats and Battery Historian, or Power Profiler in Android Studio, looking for wake locks, alarms, jobs, location and network activity while idle. Typical culprits: a wake lock not released, a periodic job or alarm running too often, a sensor or location listener never unregistered, polling, or a foreground service that never stops.

Back to Battery & Power