Jetpack Compose interview questions

State, recomposition, stability, side effects, lists, modifiers and navigation: how Compose really decides what to redraw.

6 quick facts

– interview-ready · 22 questions in this topic

– of 22 tried

Saved on this device. Interview-ready means you got it right on two different days. Guesses and hints count for less.

Questions

  1. Compose vs the View systemPick the fix
  2. What triggers recomposition?Predict
  3. remember vs rememberSaveablePredict
  4. State hoistingPick the fix
  5. Stability and skippingPredict
  6. Deferring state readsPick the fix
  7. derivedStateOfPick the fix
  8. LaunchedEffect and its keysPredict
  1. DisposableEffectFill the blank
  2. rememberCoroutineScopePick the fix
  3. rememberUpdatedStateSpot the bug
  4. Keys in LazyColumnPredict
  5. Why modifier order mattersPredict
  6. CompositionLocalPick the fix
  7. collectAsStateWithLifecycleFill the blank
  8. Navigation in ComposePick the fix
  9. Previews that scaleOrder the steps
  10. Slot APIsSpot the bug
  11. State lists and mutationSpot the bug
  12. Compose and Views togetherPick the fix
  13. Strong skipping modePredict
  14. Choosing an animation APIPick the fix

Practise this topic

Flashcards · 28

Flip, then say if you knew it. Needs JavaScript; every answer is also on its question page.

Quick quiz · 22 questions

One exercise per question, checked as you go. Needs JavaScript.

Mock interview · 4 sets

Timed, out loud, then tick what you covered. Needs JavaScript.

Fix this PR · 3 reviews

Review a diff like a senior: flag the lines you'd comment on. Needs JavaScript.

Quick facts

Recall the answer first, then tap Show to check.

Sources: Question outline adapted from Android-Interview-Questions by Mohsen Mirhoseini, licensed under Apache 2.0. We reorganised the questions, rewrote every answer and added new ones. Credits and license