Interview Questions & Answers (8+ Years Experience)
PART 1: Fundamentals → Strong Intermediate (1–50)
🔰 Core Android + Kotlin Foundations (1–15)
1. Why did Google move towards Kotlin-first for Android?
Answer:
Kotlin improves Android development through:
-
Null safety (fewer crashes)
-
Better tooling
-
Coroutines for async
-
Jetpack Compose alignment
It increases developer productivity and app stability.
![]() |
| Jetpack Compose architecture on whiteboard, MVVM, state flow |
2. What problems does Jetpack Compose solve?
Answer:
-
UI state inconsistency
-
Boilerplate code
-
Performance issues in View system
Compose provides declarative, reactive UI.
3. Difference between imperative UI and declarative UI?
Answer:
-
Imperative: How to draw UI (XML + View updates)
-
Declarative: What UI should look like for a state (Compose)
4. What is unidirectional data flow (UDF)?
Answer:
Data flows in one direction:
State → UI → Event → State Update, making UI predictable.
5. What is recomposition in Jetpack Compose?
Answer:
Recomposition redraws UI when observed state changes.
6. What triggers recomposition?
Answer:
-
State change (
mutableStateOf) -
Flow/LiveData update
-
Remembered state mutation
7. What is Kotlin’s role in Compose performance?
Answer:
-
Inline functions
-
Smart casting
-
Value classes
-
Coroutines
These reduce runtime overhead.
8. Difference between val state and mutableStateOf?
Answer:
val is immutable reference,
mutableStateOf is observable and triggers recomposition.
9. What is snapshot system in Compose?
Answer:
Manages state consistency and thread safety during recomposition.
10. How does Compose handle configuration changes?
Answer:
Using:
-
SavedStateHandle
11. What is remember vs rememberSaveable?
Answer:
-
remember: survives recomposition -
rememberSaveable: survives process death
12. What is @Composable?
Answer:
Marks a function as UI-emitting and managed by Compose runtime.
13. Why composables should be side-effect free?
Answer:
To ensure predictable recomposition and avoid UI bugs.
14. What is state hoisting?
Answer:
Moving state up the composable hierarchy for reuse and testing.
15. What is single source of truth?
Answer:
State should exist in one place only, usually ViewModel.
⚙️ Jetpack Compose Deep Concepts (16–35)
16. Difference between LaunchedEffect and SideEffect?
Answer:
-
LaunchedEffect: coroutine side effects -
SideEffect: synchronous side effects
17. What is DisposableEffect?
Answer:
Used to clean up resources when composable leaves composition.
18. When to use derivedStateOf?
Answer:
When derived value depends on other states to optimize recomposition.
19. What is CompositionLocal?
Answer:
Provides values implicitly to composables without passing parameters.
20. Difference between rememberCoroutineScope and ViewModel scope?
Answer:
-
rememberCoroutineScope → UI lifecycle
-
viewModelScope → ViewModel lifecycle
21. How does Compose optimize recomposition?
Answer:
-
Skips unchanged nodes
-
Smart invalidation
-
Stable parameters
22. What makes a composable “stable”?
Answer:
If its parameters don’t change frequently and are immutable.
23. What is @Stable annotation?
Answer:
Hints Compose runtime to optimize recomposition.
24. What is @Immutable annotation?
Answer:
Marks class as immutable for recomposition optimization.
25. Difference between Column/Row and LazyColumn/LazyRow?
Answer:
Lazy lists render items on demand, improving performance.
26. How do you handle large lists in Compose?
Answer:
-
key() usage
-
Paging 3 integration
27. What is slot API in Compose?
Answer:
Allows passing composables as content parameters.
28. What is Scaffold?
Answer:
Layout structure for TopBar, BottomBar, FAB, Snackbar.
29. What is Modifier chain?
Answer:
Modifiers decorate composables with layout, gesture, draw logic.
30. Why modifier order matters?
Answer:
Because modifiers are applied sequentially, affecting layout and drawing.
31. How do you handle click debouncing in Compose?
Answer:
-
Use coroutine delay
-
Custom modifier
32. How Compose handles gestures internally?
Answer:
Using pointerInput and gesture detectors.
33. What is pointerInput?
Answer:
Low-level API for gesture detection.
34. How to integrate legacy View in Compose?
Answer:
Using AndroidView.
35. How to migrate XML UI to Compose gradually?
Answer:
-
Use ComposeView in XML
-
Use AndroidView in Compose
🧠 Android Architecture + Kotlin (36–50)
36. Preferred architecture for Compose apps?
Answer:
MVVM + UDF + Repository pattern
37. Why ViewModel is critical in Compose?
Answer:
It:
-
Holds UI state
-
Survives config changes
-
Avoids recomposition loops
38. Flow vs LiveData in Compose?
Answer:
Flow is coroutine-native, flexible, cold — preferred.
39. How to collect Flow in Compose?
Answer:
Using collectAsState().
40. Difference between StateFlow and SharedFlow?
Answer:
StateFlow → state holder
SharedFlow → event stream
41. How to handle one-time events in Compose?
Answer:
-
SharedFlow
-
Channel
-
Event wrapper pattern
42. How Compose handles lifecycle?
Answer:
Lifecycle-aware through LifecycleOwner + effects.
43. How to avoid recomposition loops?
Answer:
-
Avoid state change inside composable body
-
Use effects properly
44. How do you test Compose UI?
Answer:
Using Compose Test Rule and semantics.
45. What is semantics in Compose testing?
Answer:
Metadata used for UI testing & accessibility.
46. How to handle accessibility in Compose?
Answer:
Using semantics modifiers.
47. How Compose improves app startup time?
Answer:
-
No XML inflation
-
Faster rendering
-
Reduced hierarchy depth
48. How do you manage themes in Compose?
Answer:
Using MaterialTheme and custom color schemes.
49. What is Material 3 in Compose?
Answer:
Latest Material design system with dynamic colors.
50. What mistakes senior developers avoid in Compose?
Answer:
-
Heavy recomposition
-
Business logic in UI
-
Mutable shared state
-
Ignoring state hoisting
![]() |
| Jetpack Compose state management diagram, recomposition flow, Kotlin coroutines |
🚀 Advanced Jetpack Compose Internals (51–70)
51. How does Compose runtime work internally?
Answer:
Compose runtime:
Builds a composition tree
Tracks state reads
Invalidates affected nodes
Performs selective recomposition
52. What is slot table in Compose?
Answer:
A data structure that stores composition state efficiently for recomposition.
53. What happens when state changes in Compose?
Answer:
State snapshot updates
Affected composables marked dirty
Recomposition scheduled
UI updated incrementally
54. How Compose avoids full UI redraw?
Answer:
Using smart invalidation and skipping unchanged composables.
55. What is key() in LazyColumn and why important?
Answer:
Provides stable identity for items, preventing UI glitches during list updates.
56. How to prevent unnecessary recomposition?
Answer:
Use immutable models
derivedStateOfAvoid lambdas recreation
Use stable parameters
57. What is rememberUpdatedState?
Answer:
Keeps latest value without triggering recomposition.
58. What are restartable vs skippable composables?
Answer:
Restartable → can recompose
Skippable → skipped if inputs unchanged
59. What is snapshotFlow?
Answer:
Converts Compose state changes into Flow stream.
60. How Compose handles threading?
Answer:
UI on Main thread
State snapshot ensures thread safety
Background updates via coroutines
61. How do animations work in Compose?
Answer:
Driven by state changes, using animation APIs like animate*AsState.
62. Difference between rememberInfiniteTransition and Animatable?
Answer:
InfiniteTransition → continuous animation
Animatable → controlled animations
63. How to debug recomposition issues?
Answer:
Layout Inspector
Recomposition counts
Compose tooling
64. How Compose handles theming internally?
Answer:
Theme values propagated via CompositionLocal.
65. How do you build custom layouts in Compose?
Answer:
Using Layout composable and measure policies.
66. How Compose differs from Flutter internally?
Answer:
Compose uses:
JVM + Kotlin
Snapshot system
Flutter uses:Skia engine + Dart VM
67. How Compose handles accessibility?
Answer:
Through Semantics tree, merged with Android accessibility framework.
68. How to optimize Compose startup time?
Answer:
Avoid heavy initial composition
Defer expensive UI
Use SplashScreen API
69. How Compose handles configuration changes internally?
Answer:
Recomposition + ViewModel state restoration.
70. When NOT to use Compose?
Answer:
Very old devices
Heavy custom OpenGL UI
Extremely legacy codebases
🧠 Kotlin Coroutines & Flow (71–85)
71. How coroutines are implemented internally?
Answer:
Using continuation passing, state machines, and dispatchers.
72. What is continuation?
Answer:
Represents state of suspended coroutine.
73. How Flow differs from RxJava?
Answer:
Flow is:
Kotlin-first
Structured concurrency
Less memory overhead
74. How to handle backpressure in Flow?
Answer:
Using:
buffer()conflate()collectLatest()
75. What is cold vs hot Flow in real apps?
Answer:
Cold → network/db calls
Hot → UI state & events
76. How to share Flow across multiple collectors?
Answer:
Using shareIn() or stateIn().
77. How to cancel coroutines properly?
Answer:
Structured concurrency
Scope cancellation
Cooperative cancellation
78. What causes coroutine leaks?
Answer:
GlobalScope misuse
Missing cancellation
Long-running jobs
79. How to debug coroutines?
Answer:
Coroutine debug mode
Logging context
Structured logs
80. What is Flow retry and error handling strategy?
Answer:
Using:
catchretryWhenSealed UI state
![]() |
| Jetpack Compose system architecture on whiteboard, large-scale app modules, Kotlin coroutines |
81. How Compose observes Flow efficiently?
Answer:
Using collectAsStateWithLifecycle().
82. Difference between Channel and SharedFlow?
Answer:
Channel → point-to-point
SharedFlow → broadcast
83. How to design UI state for Compose?
Answer:
Using:
Immutable data classes
Sealed UI states
Single source of truth
84. How to handle pagination in Compose?
Answer:
Paging 3 + LazyColumn + Flow.
85. How to handle offline-first apps?
Answer:
Room + Flow + Repository + Sync strategy.
🏗️ System Design & Real Interview Scenarios (86–100)
86. How do you design a large-scale Compose app?
Answer:
Modular architecture
Feature-based modules
Clean MVVM + UDF
87. How do you structure multi-module apps?
Answer:
Core
Domain
Data
Feature modules
88. How to manage navigation in Compose at scale?
Answer:
Typed routes
Centralized nav graph
89. How to avoid ANR in Compose apps?
Answer:
Move work off main thread
Use coroutines
Avoid heavy recomposition
90. How do you reduce APK size?
Answer:
R8/Proguard
Remove unused resources
Dynamic feature modules
91. How to handle memory leaks in Compose?
Answer:
Avoid holding context
Dispose effects properly
Cancel coroutines
92. How do you handle deep links in Compose?
Answer:
Navigation Compose + intent handling.
93. How to implement theming for multiple brands?
Answer:
Design tokens
Dynamic themes
CompositionLocal
94. How to secure sensitive data?
Answer:
EncryptedSharedPreferences
Keystore
Secure APIs
95. How do you test ViewModel + Compose?
Answer:
Unit test ViewModel
UI test composables separately
![]() |
| Jetpack Compose internals diagram showing recomposition, snapshot system, Flow integration, clean flat technical infographic |
96. How to handle feature flags?
Answer:
Remote config + runtime toggles.
97. How to migrate legacy app to Compose?
Answer:
Gradual migration with interoperability.
98. How to design error handling at app level?
Answer:
Centralized error mapper + UI states.
99. What senior-level mistakes cause Compose apps to fail?
Answer:
Business logic in UI
Mutable shared state
Poor architecture boundaries
100. What defines a strong 8+ years Android engineer?
Answer:
System thinking
Performance awareness
Architecture ownership
Mentorship mindset



