Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8668 bites

Page 199

What is a ViewModel and what lifecycle problem does it solve?
Android & Kotlin1 min read

What is a ViewModel and what lifecycle problem does it solve?

Tests config-change survival: ViewModel outlives Activity recreation so state survives rotation. Strong answer notes it holds non-serializable data and separates concerns, but does not survive process death.

Diagnose Compose recomposition issues and explain lambda stability
Android & Kotlin2 min read

Diagnose Compose recomposition issues and explain lambda stability

Tests Compose skipping and stability. Strong answers name recomposition counts, compiler metrics, and immutable state, then explain unremembered lambdas create new instances and prevent skipping.

Difference between remember and rememberSaveable
Android & Kotlin2 min read

Difference between remember and rememberSaveable

Remember survives recompositions only; rememberSaveable uses Bundle state for config changes and process death; use for UI state after recreation.

How do you display a large list efficiently in Jetpack Compose?
Android & Kotlin2 min read

How do you display a large list efficiently in Jetpack Compose?

This tests understanding of Compose lazy versus eager layout. A strong answer names LazyColumn or LazyRow, notes visible-only composition, and contrasts Column which lays out everything upfront.

Which side-effect handler for a one-time coroutine on composition entry?
Android & Kotlin2 min read

Which side-effect handler for a one-time coroutine on composition entry?

Tests Compose side-effect API boundaries. Answer: LaunchedEffect(Unit); it runs once and auto-cancels on exit. Contrast with rememberCoroutineScope for user-triggered callbacks. Red flag: picking SideEffect or rememberCoroutineScope and missing cancellation.

Describe state hoisting and its benefits in Compose
Android & Kotlin2 min read

Describe state hoisting and its benefits in Compose

Move state to the caller, pass value and event lambda down, keep them stateless.

Explain Jetpack Compose recomposition, its triggers, and optimizations.
Android & Kotlin2 min read

Explain Jetpack Compose recomposition, its triggers, and optimizations.

This tests grasp of Compose's reactive model. A strong answer defines recomposition as recomputing composables when state changes, notes State triggers it, and explains Compose skips unchanged subtrees via smart tracking.

Arrange UI elements vertically or horizontally in Jetpack Compose
Android & Kotlin2 min read

Arrange UI elements vertically or horizontally in Jetpack Compose

Tests declarative layout fundamentals. Good answers name Column and Row, explain Modifier as an ordered chain of decoration and layout behavior, and note order changes semantics. Red flag: calling Modifier "just styling" or confusing it with LinearLayout.

What is remember in Compose and how do you use mutableStateOf?
Android & Kotlin2 min read

What is remember in Compose and how do you use mutableStateOf?

This tests state survival across recompositions. Good answers say remember caches values across recompositions, pairs with mutableStateOf for observable state, and shows a counter. A red flag is mutableStateOf without remember, state resets per recomposition.

Android & Kotlin2 min read

How does ConstraintLayout enable flat responsive UIs with chains and barriers?

It tests constraint-based positioning and flat hierarchy performance. A strong answer covers relative constraints replacing nested layouts, chains for distributing groups, and barriers for dynamic alignment to extreme edges.

Difference between Style and Theme, and how ?attr/ resolves vs @color/
Android & Kotlin2 min read

Difference between Style and Theme, and how ?attr/ resolves vs @color/

Probes Android resource indirection depth. A style targets one View; a theme targets a Context. ?attr/ resolves dynamically against the current theme at runtime, but @color/ is a static compile-time constant. Red flag: saying both resolve the same way.

Explain the difference between LinearLayout, RelativeLayout, and FrameLayout
Android & Kotlin2 min read

Explain the difference between LinearLayout, RelativeLayout, and FrameLayout

Understanding of ViewGroup measurement and simplicity versus flexibility tradeoffs. LinearLayout for 1D lists, RelativeLayout for complex sibling rules, FrameLayout for single-child or overlap.

Android & Kotlin2 min read

How does Android manage ContentProvider lifecycle and threading across processes?

Tests Android IPC and provider architecture. Strong answers explain lazy per-process instantiation via AMS, ContentResolver as the client binder proxy, and query executing on a binder thread. Red flag: claiming the provider runs in the caller process.

What happens to a bound service during config changes and multiple clients?
Android & Kotlin2 min read

What happens to a bound service during config changes and multiple clients?

Tests bound service reference counting. Config change destroys the Activity binding; if no other clients exist, the service stops. Multiple clients keep it alive until the last unbind. Red flag: assuming the service survives config changes without a rebind.

Your app is killed for memory; what runs when the user returns?
Android & Kotlin2 min read

Your app is killed for memory; what runs when the user returns?

Tests process death versus config change. Answer: no callback on kill; return runs onCreate with savedInstanceState, onStart, and onResume. ViewModels die in process death; use SavedStateHandle. Red flag: claiming onDestroy fires or ViewModels survive it.

Static vs dynamic BroadcastReceiver registration and modern Android implications
Android & Kotlin2 min read

Static vs dynamic BroadcastReceiver registration and modern Android implications

Tests background limits, lifecycle coupling. Static manifest receivers survive app death but API 26 blocks most implicit broadcasts; dynamic receivers run with the context and must be unregistered. Red flag: static registration handles all implicit broadcasts.

When and why use a Foreground Service on API 26+?
Android & Kotlin2 min read

When and why use a Foreground Service on API 26+?

Tests background execution limits. Good answer: use for noticeable long-running work; declare FOREGROUND_SERVICE, show a notification, and respect API 26 background start limits. Red flag: calling it invisible work or omitting the notification.

Describe the back stack for A to B to C with singleTask
Android & Kotlin2 min read

Describe the back stack for A to B to C with singleTask

Tests singleTask plus taskAffinity, not rote memorization. With default affinity, C sits atop B in the same task; if C already existed, the system clears B and delivers onNewIntent. Red flag: claiming singleTask always spawns a new task.

Activity rotation: what happens to EditText text?
Android & Kotlin2 min read

Activity rotation: what happens to EditText text?

Rotation destroys and recreates the Activity; EditText auto-saves text if it has an ID, else onSaveInstanceState or SavedStateHandle.

Describe the Android Activity lifecycle and callback order
Android & Kotlin2 min read

Describe the Android Activity lifecycle and callback order

Away calls onPause then onStop; back calls onRestart, onStart, onResume; onCreate only runs after destruction.