Walk me through the lifecycle of an Android Activity and why you need to care about it as a developer.

technical-conceptual · Junior level · software-engineering

What the interviewer is really asking

Tests whether the candidate understands Android's lifecycle callbacks and connects them to real concerns like state preservation and resource cleanup, rather than just listing method names.

What to say

What to avoid

Example answers

Strong: The system calls onCreate when the Activity is first created — that's where I inflate the UI and read saved state. onStart/onResume mean it's visible and interactive, onPause/onStop mean it's going to the background, and onDestroy is teardown. I start camera or location work in onStart and stop it in onStop so I'm not draining battery off-screen. Because a rotation destroys and recreates the Activity, I keep UI state in a ViewModel so it survives instead of getting wiped.

Weak: There's onCreate, onResume, onPause, onDestroy and a few others. I mostly just put everything in onCreate and it works fine for the screens I've built.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.