Lifecycle, LiveData & repeatOnLifecycle

ARCHITECTURE › Components

Lifecycle-aware data observation: LiveData, LifecycleOwner, repeatOnLifecycle, and Flow tradeoffs.

Interviewers use this topic to check whether you can keep UI in sync with data without leaking memory or crashing on stopped screens. Expect questions on LiveData's active/inactive model, lifecycle states and observers, and the modern way to collect Flows safely with repeatOnLifecycle or collectAsStateWithLifecycle. Strong answers explain WHY launchWhenStarted is deprecated and when to pick Flow over LiveData.

What this covers

Study this topic

Further reading