For the complete documentation index, see llms.txt. This page is also available as Markdown.

Compose

Fundamentals & Recomposition

  1. Explain the difference between remember and rememberSaveable and when each is appropriate.

  2. What triggers recomposition in Compose, and how does the compiler optimize it via stability inference?

  3. How do @Stable, @Immutable, and @NonRestartableComposable annotations affect recomposition behavior?

  4. Why is it problematic to pass unstable types (e.g., ArrayList, ViewModel) directly into Composable parameters?

  5. What is the role of SnapshotState and how does it integrate with Compose's observation system?

  6. Explain the difference between derivedStateOf and remember(key) — when would you choose one over the other?

  7. What happens if you write var text by remember { mutableStateOf("") } inside a Composable versus hoisting it to a ViewModel?

State Management & Architecture

  1. How do you implement unidirectional data flow in a Compose-heavy application?

  2. What are the trade-offs between ViewModel state holders versus plain class state holders in Compose?

  3. How do you handle configuration changes (e.g., rotation) with Compose state without relying on ViewModel?

  4. Describe the purpose and limitations of CompositionLocal — when is it appropriate to use versus avoid?

  5. How would you share state between sibling Composables without passing callbacks through multiple layers?

  6. What is the difference between produceState, collectAsState, and collectAsStateWithLifecycle?

  7. How do you gracefully handle process death and restoration with Compose Navigation?

Performance & Optimization

  1. What is the "donut-hole skipping" optimization in Compose, and how do you ensure your code benefits from it?

  2. How does LazyColumn differ from RecyclerView in terms of item recycling and composition strategy?

  3. What is the cost of using Modifier chains extensively, and how do you optimize them?

  4. When should you use key in LazyColumn or LazyRow, and what happens if you omit it?

  5. How do you debug and fix recomposition loops or excessive recompositions in a large screen?

  6. Explain the impact of using BoxWithConstraints or SubcomposeLayout on performance.

  7. What tools do you use to measure Compose frame times and recomposition counts in production?

Custom Layouts & Graphics

  1. How would you build a custom layout using Layout composable? What are MeasurePolicy and IntrinsicMeasurable?

  2. What is the difference between SubcomposeLayout and the standard Layout composable?

  3. How do you create a custom Modifier using Modifier.Node versus the older Modifier.composed approach?

  4. Explain how DrawScope and Canvas work in Compose — how do you handle touch events on custom drawn elements?

  5. How would you implement a staggered grid layout before LazyVerticalStaggeredGrid existed in Compose?

  1. How does Compose Navigation differ from the Fragment-based Navigation Component in terms of lifecycle and back stack?

  2. How do you handle nested navigation graphs with independent back stacks in Compose?

  3. What are the challenges of using type-safe navigation with Compose Navigation, and how do you implement it?

  4. How do you manage screen transitions and shared element transitions between destinations in Compose Navigation?

  5. Explain how you would implement a bottom navigation bar with multiple back stacks using Compose Navigation.

Interoperability & Migration

  1. How do you embed a View inside Compose and vice versa? What are the lifecycle implications?

  2. What is AndroidView and when should you prefer it over rewriting a custom view in Compose?

  3. How do you gradually migrate a large XML-based codebase to Compose without a full rewrite?

  4. What are the challenges of using Compose inside RecyclerView or ViewPager2?

  5. How do you handle WindowInsets when mixing Compose and legacy View-based screens?

Testing

  1. How do you write unit tests for Composables? What is the role of createComposeRule?

  2. What is semantic testing in Compose, and how do you use SemanticsMatcher and SemanticsNodeInteraction?

  3. How do you test state hoisting and verify that state changes trigger recompositions correctly?

  4. What are the limitations of Compose UI testing compared to Espresso, and how do you work around them?

  5. How do you perform screenshot or visual regression testing for Compose UIs?

Animation & Gestures

  1. Explain the difference between animate*AsState, updateTransition, and AnimatedContent.

  2. How do you implement a draggable list item with reordering in Compose?

  3. What is the difference between pointerInput and Modifier.draggable / Modifier.swipeable / Modifier.anchoredDraggable?

  4. How do you coordinate animations across multiple Composables using Animatable and coroutines?

  5. How would you implement a shared element transition between two screens in Compose?

Theming & Design Systems

  1. How do you build a multi-theme design system in Compose that supports dynamic color, light/dark mode, and brand themes?

  2. What is the role of CompositionLocalProvider in theming, and how do you avoid overusing it?

  3. How do you handle typography scaling and accessibility font sizes gracefully in Compose layouts?

  4. How do you implement a custom ripple effect or remove the default ripple in Material3 Compose?

Build & Tooling

  1. What Compose compiler metrics do you monitor (e.g., reportsDestination), and how do you act on them?

  2. How does the Compose Compiler plugin differ from standard Kotlin compilation, and what version alignment issues have you encountered?

  3. What is the impact of enabling/disabling strongSkipping mode in the Compose compiler?

  4. How do you manage Compose version alignment across a multi-module project with different teams?

System & Edge Cases

  1. How do you handle SurfaceView or TextureView content (e.g., camera, video) within a Compose layout?

  2. What are the implications of using Compose in a Service or Widget context (e.g., Glance)?

  3. How do you manage memory leaks in Compose, particularly with remember holding references to lifecycle-bound objects?

  4. How do you implement a responsive layout that adapts to foldable devices or large screens using Compose?

  5. What is the Recomposer and when would you need to interact with it directly?

  6. How do you handle text input fields with complex formatting (e.g., credit cards, phone numbers) in Compose?

Last updated