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.

4330 bites

Page 199

Describe state hoisting in Jetpack Compose.
Android & Kotlin2 min read

Describe state hoisting in Jetpack Compose.

Tests your grasp of unidirectional data flow. Explain state hoisting is moving state up to make composables stateless. This improves reusability, testability, and creates a single source of truth. A red flag is defining it without explaining the benefits.

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.

Which Compose side-effect for a one-time coroutine action?
Android & Kotlin2 min read

Which Compose side-effect for a one-time coroutine action?

Tests if you can choose the right Compose side-effect for a one-time coroutine. A great answer names LaunchedEffect(Unit), explains it runs once and cancels on exit. A red flag is suggesting rememberCoroutineScope directly in the composable body.

Which side-effect handler for a one-time coroutine action in Compose?
Android & Kotlin2 min read

Which side-effect handler for a one-time coroutine action in Compose?

This tests your understanding of Compose lifecycles and side-effect handlers. A good answer names LaunchedEffect(Unit), explaining the constant key ensures the effect runs only once. A red flag is suggesting launching coroutines on every recomposition.

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.

How to implement efficient large lists in Jetpack Compose?
Android & Kotlin2 min read

How to implement efficient large lists in Jetpack Compose?

This tests your grasp of Compose performance. Use LazyColumn to compose only visible items, unlike a Column which renders all items at once. A red flag is suggesting a scrollable Column, which has severe performance costs for large lists.

Implement an efficient list in Jetpack Compose
Android & Kotlin2 min read

Implement an efficient list in Jetpack Compose

Tests your grasp of UI virtualization in Compose. Answer: Use LazyColumn as it only composes visible items. Contrast this with Column, which composes all items at once, causing poor performance. Mention the items DSL.

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.

`remember` vs. `rememberSaveable`: When and why to use each?
Android & Kotlin2 min read

`remember` vs. `rememberSaveable`: When and why to use each?

Tests understanding of state survival in Compose. A good answer contrasts remember (for composition) with rememberSaveable (for activity recreation/process death), explaining its use of the Bundle mechanism. A red flag is confusing the two lifecycles.

remember vs. rememberSaveable: When and Why to Use Each
Android & Kotlin2 min read

remember vs. rememberSaveable: When and Why to Use Each

Tests understanding of Compose state survival. remember is for recomposition scope. rememberSaveable survives activity recreation and process death via a Bundle, requiring custom Savers for complex types. Red flag: saying remember survives rotation.

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.

How do you diagnose and fix excessive recomposition in Jetpack Compose?
Android & Kotlin2 min read

How do you diagnose and fix excessive recomposition in Jetpack Compose?

This tests your grasp of Compose's stability system. First, use Layout Inspector to find high-recomposition areas. Then, enable and analyze the Compose compiler report to diagnose unstable parameters (like List) or lambdas.

How do you diagnose and fix excessive recomposition in Jetpack Compose?
Android & Kotlin2 min read

How do you diagnose and fix excessive recomposition in Jetpack Compose?

This tests your understanding of Compose's stability system for performance. Use the Layout Inspector and Compiler Metrics to find unstable composables, then fix them with immutable data types and stable lambdas.

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.

What is a Jetpack ViewModel and the problem it solves?
Android & Kotlin2 min read

What is a Jetpack ViewModel and the problem it solves?

This tests your understanding of lifecycle-aware state preservation. A good answer explains that ViewModels survive configuration changes (like rotation) to hold UI data, separating it from the transient UI controller.

What problem does Jetpack ViewModel solve during configuration changes?
Android & Kotlin2 min read

What problem does Jetpack ViewModel solve during configuration changes?

This tests your understanding of state loss during configuration changes. A good answer explains that Activities are destroyed on rotation, and ViewModel survives this event, preserving UI state.

Explain the roles of ViewModel, Repository, and data source in MVVM
Android & Kotlin2 min read

Explain the roles of ViewModel, Repository, and data source in MVVM

Tests your grasp of unidirectional data flow and separation of concerns in Android MVVM. A strong answer maps ViewModel to UI state, Repository to data coordination, and Room or Retrofit to I/O.

Explain ViewModel, Repository, and Data Source in MVVM
Android & Kotlin2 min read

Explain ViewModel, Repository, and Data Source in MVVM

This tests your understanding of separation of concerns. A great answer defines ViewModel (UI state), Repository (data abstraction), and Data Sources (implementation), then explains the unidirectional data flow.

Explain ViewModel, Repository, and Data Source in MVVM
Android & Kotlin2 min read

Explain ViewModel, Repository, and Data Source in MVVM

This tests your grasp of separation of concerns in Android. A good answer defines ViewModel, Repository, and Data Source roles, then traces the unidirectional data flow. A red flag is having the ViewModel directly access a data source like Retrofit.

How do you pass data between Fragments with Jetpack Navigation?
Android & Kotlin2 min read

How do you pass data between Fragments with Jetpack Navigation?

Define args in nav graph XML, navigate with generated Directions, read with navArgs() in target Fragment.