Compose Mental Model & Phases
UI › Compose Core
How Compose turns state into UI across composition, layout, and drawing phases.
Interviewers use this topic to check whether you understand Compose as a declarative, state-driven framework rather than imperative view mutation. Expect questions on what recomposition is, when each of the three phases re-runs, why composables must be pure, and how Compose identifies and skips composables. Strong answers connect positional memoization, stability, and phase-aware state reads to real performance wins.
What this covers
- What a composable function is: data-in, no return, must be fast, idempotent, side-effect free
- The three phases (composition, layout, drawing) and which one a given state read re-runs
- What triggers recomposition and the rules for skipping it (Unit return, stable + unchanged inputs)
- Positional memoization and call-site identity, plus when key() is needed
- Why composables can run in any order, frequently, and potentially in parallel
- Deferring state reads to a later phase to avoid needless recomposition
Study this topic
- Compose Mental Model & Phases explained: the guided lesson
- 13 practice quiz questions
- 9 revision flashcards
- Compose Mental Model & Phases interview questions and answers