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 226

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.

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.

Explain Recomposition in Jetpack Compose
Tests your grasp of Compose's declarative model. A good answer defines recomposition, explains state-read triggers, and details how stability and positional memoization enable skipping. A red flag is assuming any state change redraws the entire UI.

How to arrange UI elements in Jetpack Compose?
This tests your grasp of Compose's declarative layout basics. A good answer defines Column (vertical) and Row (horizontal) for structure, and Modifier for decoration, size, and behavior. A red flag is confusing Modifiers with simple styling.

What is the purpose of the `remember` function in Compose?
This tests your grasp of recomposition. Explain that remember stores an object in the composition tree, preventing it from being re-initialized on every render. A red flag is confusing it with rememberSaveable, which survives configuration changes.
How does ConstraintLayout enable complex, responsive UIs?
Tests your grasp of modern Android UI performance and responsiveness. Explain how relative positioning flattens hierarchies, then define chains for distributing space and barriers for handling dynamic content size.

Styles vs. Themes and Attribute Resolution in Android
This tests your grasp of Android's resource indirection. A Style is a set of attributes for one View type. A Theme is a collection of named attributes for an app or Activity. ?attr is resolved at runtime against the Theme, while @color is a direct.

LinearLayout vs. RelativeLayout vs. FrameLayout: Explain and give use cases
Tests your grasp of classic Android layouts and performance trade-offs. A good answer defines each, gives a clear use case, and mentions layout_weight. A red flag is proposing nested LinearLayouts for complex UIs, ignoring performance.
How does Android manage a ContentProvider's lifecycle during a query?
This tests your understanding of Android IPC and component lifecycles. Explain how ContentResolver uses a URI to have the system instantiate the provider in its own process.

Bound Service Lifecycle: Config Changes and Multiple Clients
Tests deep knowledge of bound service lifecycles. A config change causes an unbind/rebind cycle, recreating the service. With multiple clients, the service isn't destroyed until the last one unbinds. Red flag: assuming the service survives the config change.

Handle Android Process Death vs. Configuration Changes
Tests your grasp of Android's lifecycle for state restoration. A good answer explains that onCreate(savedInstanceState) is called in both cases, but process death recreates everything. Use ViewModel with SavedStateHandle.

Static vs. Dynamic BroadcastReceivers: Implications and Restrictions
This tests your knowledge of Android's background execution limits. A good answer defines static and dynamic registration, explains the restrictions since Android 7/8, and gives use cases. A red flag is ignoring the modern API limitations.

When and why use a Foreground Service on modern Android?
Tests understanding of background work restrictions. A great answer defines the use case for user-visible tasks, explains the mandatory notification, and details the startForegroundService() flow.

singleTask Launch Mode: A -> B -> C Back Stack
This tests your understanding of Android's singleTask launch mode and task management. A good answer explains that A and B form a stack in one task, while C launches into a new, separate task, becoming its root.

How does a ViewModel survive configuration changes?
Tests understanding of ViewModel's scope, separate from the Activity lifecycle. A ViewModel is retained by a ViewModelStore, which persists across configuration changes. The new Activity instance then reconnects to the same ViewModel.

Started vs. Bound Services: Differences and Use Cases
Tests your grasp of Android component lifecycles. A strong answer defines each by its lifecycle control (who starts/stops it) and communication pattern (fire-and-forget vs. client-server), then gives distinct use cases.

How do you save UI state during screen rotation?
Tests your grasp of the Activity lifecycle and state restoration. A great answer explains the destroy/recreate cycle, notes that EditText handles its own state via its ID, and contrasts the modern ViewModel + SavedStateHandle with the older…

Describe the Android Activity lifecycle when navigating away and back
Tests understanding of resource management via lifecycle callbacks. A good answer traces onPause -> onStop -> onRestart -> onStart -> onResume, explaining what work happens in each.
How would you manage API keys in Gradle without version control?
Tests secure credential handling in Android builds. A good answer proposes the Secrets Gradle Plugin, which reads from an untracked properties file and exposes keys via BuildConfig, while also noting this doesn't protect against APK decompilation.

How do you diagnose a memory leak with Android Studio Profiler?
This tests your systematic process for debugging memory issues. A good answer outlines using the Memory Profiler, forcing GC, capturing heap dumps, and analyzing object references. A red flag is just naming the tool without explaining the 'how'.