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 211

Why is LiveData<Boolean> bad for one-time ViewModel events?
Tests if you know LiveData holds state, not events. A good answer explains that LiveData re-emits on configuration changes, causing repeated events. The solution is to model events as part of the UI state and consume them.

How do you pass data between Fragments with Jetpack Navigation?
Tests knowledge of modern, type-safe argument passing. A good answer defines the argument in the nav graph XML, uses the Safe Args plugin to generate Directions/Args classes, navigates with the action, and retrieves the data in the destination via `by…

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.

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.

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.

`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.

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.

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.

Describe the state hoisting pattern in Compose
Tests your grasp of unidirectional data flow. Explain state hoisting is moving state up to make composables stateless. This enables reusability, easier testing, and a single source of truth. A red flag is just describing the mechanics without the benefits.

Explain Recomposition in Jetpack Compose
This tests your core understanding of Compose's declarative model. Explain that recomposition is re-running composables when state they read changes. Mention that Compose optimizes by only recomposing the nearest scope and skipping composables with stable…

How do you arrange UI elements in Jetpack Compose?
Tests your grasp of Compose's declarative layout model. Explain Row (horizontal) and Column (vertical) as the core layout composables. Define Modifier as the standard way to configure size, spacing, and behavior.

What is the purpose of `remember` in Jetpack Compose?
This tests your grasp of Compose's recomposition lifecycle. A good answer explains remember caches an object across recompositions, preventing state loss. It's used with mutableStateOf to hold the same state instance.
Explain ConstraintLayout, Chains, and Barriers
Tests your grasp of performant Android UIs. Explain how ConstraintLayout flattens hierarchy, use chains to distribute groups of views (e.g., packed), and use barriers to align elements against dynamic content.

Android Style vs. Theme and Attribute Resolution
Tests your grasp of Android's resource scope and resolution timing. A Style targets a single View, while a Theme applies to a whole Context. @color/ is a direct, compile-time link; ?attr/ is an indirect pointer resolved against the Theme at runtime.

LinearLayout vs. RelativeLayout vs. FrameLayout
This tests your knowledge of fundamental View layouts and performance trade-offs. Define LinearLayout (single axis), RelativeLayout (relative positioning), and FrameLayout (stacking), giving a clear use case for each.
ContentProvider Lifecycle During Cross-Process Queries
Tests knowledge of Android's IPC, process management, and threading for ContentProviders. The ContentResolver asks AMS to find/start the provider's process. The provider's onCreate() runs on the main thread, but the query() itself runs on a binder thread.

Bound Service Lifecycle with Config Changes & Multiple Clients
Tests your grasp of bound Service lifecycles. Explain that with BIND_AUTO_CREATE, the Service survives an Activity's config change recreation. It's only destroyed after the *last* client unbinds. A red flag is assuming the Service dies with the first client.

Explain app restoration after Android process death
Tests your grasp of process death vs. configuration changes. A good answer explains that the entire app process is recreated, starting with onCreate, and state must be restored from the SavedStateHandle.

Static vs. Dynamic BroadcastReceivers: Implications & Restrictions
This tests your grasp of Android's background restrictions. Explain that static receivers live with the app but are restricted post-API 26, while dynamic receivers are tied to a component's lifecycle. Ignoring modern API restrictions is a major red flag.

When and why to use a Foreground Service?
Tests your grasp of Android's background execution limits. A great answer explains they're for user-visible tasks like music playback, requires startForegroundService(), and must show a notification within 5 seconds.