AceMobileInterview

Interview guides / android

Jetpack Compose Interview Questions

Jetpack Compose interview questions on recomposition, state hoisting, side effects, LazyColumn, and performance.

Compose interviews focus on recomposition triggers, state ownership, side effects, and list performance.

If you can explain why a composable recomposes and how to keep LazyColumn smooth, you are ahead of most candidates.

  1. 1.How do UI test stacks differ?

    Espresso for Views; Compose testing APIs for semantics nodes. Prefer idling resources/synchronization; keep UI tests for critical paths.

  2. 2.Difference between remember and rememberSaveable?

    remember survives recomposition only. rememberSaveable also survives config change via saveable registry. Neither survives process death unless backed by SavedState.

  3. 3.When do you use an Activity vs a Fragment?

    Activity is a screen entry point/window host. Fragments compose reusable UI within an activity (tabs, master-detail). Prefer single-activity + navigation component for many modern apps.

  4. 4.When is ConstraintLayout still useful?

    Complex XML view hierarchies; Compose ConstraintLayout for similar relative positioning. Prefer simpler Column/Row when enough.

  5. 5.Why provide key in LazyColumn items?

    Stable identity for item reuse/animations and correct state restoration. Without keys, items can show wrong state when the list reorders.

  6. 6.When should you use derivedStateOf?

    When computing from frequently changing state but result changes rarely—reduces recompositions (e.g. list scroll threshold).

  7. 7.What invalidates Compose UI?

    Reads of changing state in composition. Minimize unnecessary reads; hoist state; use keys in lists; stable parameters help skip recomposition.

  8. 8.How do you handle edge-to-edge and IME insets?

    Enable edge-to-edge, consume WindowInsetsCompat / Compose imePadding/systemBarsPadding. Don’t hardcode status bar heights.

  9. 9.Explain unidirectional data flow on Android.

    Events in → reduce state → render. Single source of truth StateFlow/Compose state. Side effects (nav, toasts) handled explicitly to avoid duplicating on recomposition.

  10. 10.How do you pass arguments and handle back stack with Navigation Compose?

    NavHost routes with typed args/safe args patterns; rememberNavController; single activity. Avoid passing complex objects—pass IDs and load from repo.

  11. 11.What happens on rotation and how do you preserve UI state?

    Activity may be destroyed/recreated. Use ViewModel + SavedStateHandle, rememberSaveable in Compose, or onSaveInstanceState. Avoid heavy objects in saved state bundles.

  12. 12.What triggers recomposition, and how do you keep Compose performance healthy?

    State reads in composition invalidate that scope. Use remember/derivedStateOf, stable keys in Lazy lists, avoid unstable lambdas where it matters, hoist state, and use immutable models. Profile with Layout Inspector and Compose tracing.

  13. 13.Compare LaunchedEffect, DisposableEffect, SideEffect.

    LaunchedEffect: coroutine tied to key. DisposableEffect: setup/cleanup for non-coroutine resources. SideEffect: publish composition to non-Compose world each successful compose. Don’t block composition.

Keep going with AceMobileInterview

Reading helps. Timed practice locks it in. Jump into the interactive track for algorithms with LeetCode links, studio projects, debugging zips, and mobile system design.

iOS trackAndroid trackMore guides