All jobs / Mobile developer / Device Capabilities
Mobile developer interview question · 1–3 years
A step-counting screen keeps draining the battery long after the user has moved on to another screen. What do you check first?
The strongest answer
Whether the sensor listener is unregistered when the screen stops. Registration follows the screen’s lifecycle — start when it becomes visible, stop when it does not — and the sample rate should be the slowest that works
Why it works
Right — a sensor you forgot to stop is a background drain with no UI, and the rate is the other half of the cost.
What a good answer covers
- Register with the screen, unregister with it.
- Start when visible, stop when hidden.
- Pick the slowest usable rate.
- Never leave a sensor running.
Answers that fall short
- Close, but not the strongest: Whether we unregister the listener when the screen is destroyed
Close, but destruction may come much later or not at all; stop it when the screen stops being visible. - Weak: Whether that sensor is simply expensive; I would warn the user in the UI that it uses battery
Warning the user does not reduce the drain, and the app is doing work nobody is looking at. - Red flag: I would keep it registered for the life of the app so the step count is continuous and nothing is missed
Continuous high-rate sensing with no one watching is exactly what puts an app in the battery-hog list.
Who gets asked this
More Device Capabilities questions
- The feature is “attach one photo.” Which permission story is right in 2026?
- You add biometric unlock. What else must exist?
- Product asks for location “always” so a map feels snappier. What do you do?
- A delivery app asks for the highest-accuracy location updates continuously so the map pin never lags. How do…
- Product wants the app to notice NFC tags as the user walks past them, with the app closed. What do you tell…
- A field app talks to a Bluetooth sensor. In the lab it is solid; in the field users say it “just stops”. How…
- The feature is “attach a photo to a report”. Do you build a camera screen inside the app?