Skip to content
RED SAGSkills
easyMobile App Developer interview question

Explain the lifecycle of a mobile app screen. Why does it matter?

What the interviewer wants to hear

  • Screens move through created, started/visible, resumed/active, paused, stopped, destroyed
  • Release resources like camera or sensors when paused or stopped
  • The OS can kill a backgrounded app
  • Save state so the user can continue where they left off
  • Start and stop observing data at the right time

Model answer

A screen goes through states as the user uses the app. On Android, an Activity goes through onCreate, onStart and onResume when it opens, and onPause, onStop and onDestroy when it leaves. iOS and SwiftUI have similar events like onAppear and scene phases for active, inactive and background. It matters because phones have limited resources. I must stop things like the camera, location updates or video when the screen is not visible, otherwise I waste battery. The OS can also kill the app while it is in the background, so I save important state, like form input, and restore it when the user returns. Lifecycle-aware tools, like collecting flows with repeatOnLifecycle, help do this correctly.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Mobile App Developer questions