AND

Test yourself

Quiz — Multiple Choice

Pick an answer; it instantly marks it right or wrong and explains why. Your answers are saved in this browser, so you can come back and finish.

Score 0 / 0 answered · 162 total
  1. Q1What does the Elvis operator ?: do?Kotlin
  2. Q2Which scope function returns the receiver object (not the lambda result)?Kotlin
  3. Q3Why does an exhaustive `when` over a sealed type need no `else`?Kotlin
  4. Q4What does `reified` require to work?Kotlin
  5. Q5`List<out T>` expresses which kind of variance?Kotlin
  6. Q6What does a Baseline Profile improve?Optimization
  7. Q7A Composable re-runs on every recomposition even though its data looks unchanged. Most likely cause?Optimization
  8. Q8Best key for a LazyColumn whose items can reorder or be deleted?Optimization
  9. Q9What's the correct first step before optimizing performance?Optimization
  10. Q10An ANR is most often caused by what?Optimization
  11. Q11Which tool auto-detects retained objects and shows the reference chain in debug builds?Optimization
  12. Q12Why prefer an Android App Bundle (AAB) over a universal APK?Optimization
  13. Q13What does on-device inference primarily buy you?On-Device AI
  14. Q14How do apps typically access Gemini Nano on Android?On-Device AI
  15. Q15Why quantize an on-device model (e.g. int4/int8)?On-Device AI
  16. Q16Best way to ship a multi-hundred-MB on-device model?On-Device AI
  17. Q17In Kotlin, `a == b` on two data class instances compares…Kotlin
  18. Q18What does a @JvmInline value class primarily provide?Kotlin
  19. Q19Edge-to-edge layouts should pad around system bars using…Optimization
  20. Q20Excessive 'red' in the Debug GPU Overdraw tool indicates…Optimization
  21. Q21Why batch token emissions when streaming an on-device LLM into Compose?On-Device AI
  22. Q22Gemini Nano is hosted by which Android system component?On-Device AI
  23. Q23In a coroutineScope, one child throws. What happens to the siblings?Coroutines
  24. Q24Why is `catch (e: Exception)` around a suspend call risky?Coroutines
  25. Q25Which operator cancels the previous inner flow when a new value arrives?Coroutines
  26. Q26flowOn(Dispatchers.IO) affects which part of the chain?Coroutines
  27. Q27What makes coroutine cancellation actually stop a tight CPU loop?Coroutines
  28. Q28Which emits whenever ANY source emits, pairing with the latest of the others?Coroutines
  29. Q29What is mandatory inside callbackFlow to avoid leaking the listener?Coroutines
  30. Q30Why prefer Mutex.withLock over synchronized inside a coroutine?Coroutines
  31. Q31A Channel-based event delivers each event to…Coroutines
  32. Q32Where does an exception from `async` surface?Coroutines
  33. Q33Reading scroll offset only inside Modifier.offset { } lambda avoids what?Compose
  34. Q34Why might a Composable taking List<T> never be skipped?Compose
  35. Q35You need the latest onClick lambda inside a long-running keyed effect without restarting it. Use…Compose
  36. Q36derivedStateOf is the right tool when…Compose
  37. Q37Which launches a coroutine from a button's onClick?Compose
  38. Q38Modifier.padding(16.dp).background(Blue) vs .background(Blue).padding(16.dp) differ because…Compose
  39. Q39Which collects ViewModel StateFlow with lifecycle awareness in Compose?Compose
  40. Q40Why prefer LazyColumn over Column(verticalScroll) for a long list?Compose
  41. Q41A ViewModel survives rotation but loses state after the OS kills the backgrounded app. The fix?Framework
  42. Q42Why observe LiveData/Flow with viewLifecycleOwner in a Fragment?Framework
  43. Q43Which work API guarantees execution across process death and reboot with constraints?Framework
  44. Q44User taps Refresh 10 times. How do you avoid 10 queued sync jobs?Framework
  45. Q45When is a foreground Service the right choice?Framework
  46. Q46Why won't a manifest-registered receiver fire for most implicit broadcasts on modern Android?Framework
  47. Q47Which Hilt annotation efficiently binds an interface to its implementation?DI
  48. Q48Two bindings of the same type cause a Hilt build error. The fix?DI
  49. Q49Why prefer constructor injection over field injection?DI
  50. Q50A Room @Query returning Flow<List<T>> does what when the table changes?Data
  51. Q51Main reason DataStore is preferred over SharedPreferences?Data
  52. Q52Which Paging 3 component implements offline-first network+DB paging?Data
  53. Q53What makes coroutine tests deterministic?Testing
  54. Q54Which library asserts Flow emissions with awaitItem()?Testing
  55. Q55Compose UI tests assert against what?Testing
  56. Q56Why migrate annotation processing from kapt to KSP?Gradle
  57. Q57Defaulting to `implementation` over `api` mainly buys you…Gradle
  58. Q58A feature works in debug but crashes in release with a 'class not found'. Likely cause?Gradle
  59. Q59Inside a supervisorScope, you launch two children with launch{}: child A throws an exception after 100ms, child B is still running a long-lived collection. No CoroutineExceptionHandler is installed anywhere in the hierarchy. What happens?Coroutines
  60. Q60Why does wrapping only the async{} call (not the subsequent .await()) in a try/catch fail to catch an exception thrown inside that async block?Coroutines
  61. Q61Given `flowOf(1,2,3).onEach { delay(100) }.conflate().collect { value -> delay(300); println(value) }`, roughly which values print, assuming the producer emits faster than the collector consumes?Coroutines
  62. Q62What's the most accurate description of why flatMapLatest is preferred over flatMapMerge for a 'load details when selected item changes' use case?Coroutines
  63. Q63In a runTest block using the default StandardTestDispatcher, why might `val job = launch { repository.observe().collect { results.add(it) } }` followed immediately by an assertion on `results` fail, even though the flow should have emitted by then?Coroutines
  64. Q64A function catches exceptions like this: `try { doSuspendWork() } catch (e: Exception) { Log.e(...) }`. What's the specific danger of this pattern inside a coroutine that can be cancelled (e.g. tied to a ViewModel's viewModelScope)?Coroutines
  65. Q65Which statement correctly distinguishes debounce(300) from conflate() on a Flow<String> representing a search text field's changes?Coroutines
  66. Q66A composable takes a parameter of type List<Item> where Item is a @Immutable data class. Will the composable be skippable based on that parameter?Compose
  67. Q67What is the key behavioral difference between compositionLocalOf and staticCompositionLocalOf?Compose
  68. Q68Inside a composable, you write val isAtTop by remember { derivedStateOf { listState.firstVisibleItemIndex == 0 } } . What is the main benefit over writing val isAtTop = listState.firstVisibleItemIndex == 0 directly?Compose
  69. Q69Which side-effect API is the correct choice for registering a BroadcastReceiver (or similar external listener) when a composable enters composition, and unregistering it when the composable leaves?Compose
  70. Q70Strong skipping mode is enabled (the default with current Compose compiler versions). A composable has one unstable parameter and no stable parameters changed. What happens on the parent's recomposition?Compose
  71. Q71Why is rememberSaveable insufficient as a substitute for persisting user data to a database or DataStore?Compose
  72. Q72A binding is declared @Binds @IntoSet inside a module installed in ActivityComponent, contributing to Set<Validator>. A ViewModel (scoped to ActivityRetainedComponent) tries to inject Set<Validator>. What happens?DI
  73. Q73Which statement correctly distinguishes @AssistedInject from plain @Inject constructor injection?DI
  74. Q74What is the correct fix when Dagger reports it cannot resolve Set<Tracker> at an injection site, even though multiple modules contribute @Binds @IntoSet bindings for Tracker, all written in Kotlin?DI
  75. Q75Why does Hilt forbid @AndroidEntryPoint on a ContentProvider, requiring @EntryPoint + EntryPointAccessors instead?DI
  76. Q76In a Hilt instrumented test, you add @BindValue lateinit var fakeRepo: FakeRepository = FakeRepository() to replace the real Repository binding used elsewhere via constructor injection of `repository: Repository`. The override silently has no effect at injection sites expecting Repository. What's the most likely cause?DI
  77. Q77What does @TestInstallIn's `replaces` attribute do that a plain second @Module with the same @InstallIn target cannot?DI
  78. Q78A class needs an OkHttpClient with custom interceptors built from a Config object that itself comes from the graph. Which approach is correct and idiomatic?DI
  79. Q79A screen has `isLoading: Boolean`, `errorMessage: String?`, and `items: List<Item>` as three separate StateFlow fields in an MVVM ViewModel. What is the main architectural risk this design has that a single sealed MVI State avoids?Architecture
  80. Q80Why does Clean Architecture require the domain layer to define repository interfaces rather than letting the data layer define them and the domain layer import that interface from data?Architecture
  81. Q81In a multi-module Gradle build, module `:feature-checkout` depends on `:core-network` using `implementation`. Module `:app` depends on `:feature-checkout`. What can `:app` directly reference from `:core-network`'s public API as a result?Architecture
  82. Q82What is the specific functional difference between a one-shot Effect/SideEffect channel and the State stream in an MVI ViewModel?Architecture
  83. Q83A team puts a shared `ApiClient` class used by five different feature modules inside `:feature-checkout` because that's where it was first needed. What's the direct consequence for the other four feature modules?Architecture
  84. Q84Why does `ViewModel` surviving a configuration change (e.g. rotation) NOT make `SavedStateHandle` redundant for persisting screen state like form input?Architecture
  85. Q85In single-Activity architecture using Navigation Compose, why is a feature pushing a second Activity onto the task stack (instead of a destination in the shared NavController's graph) considered an architectural break?Architecture
  86. Q86An app targeting API 34 starts a foreground service for a large file upload but declares android:foregroundServiceType="dataSync" without adding the FOREGROUND_SERVICE_DATA_SYNC permission. What happens at runtime on a device running Android 14?Framework
  87. Q87A unique periodic WorkRequest named "daily-sync" is already enqueued and running fine. The app re-enqueues it with the same name using ExistingPeriodicWorkPolicy.KEEP, but with a different network constraint. What happens?Framework
  88. Q88Which statement about expedited WorkRequests on API 31+ (Android 12+) is correct?Framework
  89. Q89A Worker's doWork() needs roughly 25 minutes to complete a one-shot task on a typical Android device. What is the most correct way to handle this with WorkManager?Framework
  90. Q90Why does WorkManager require explicit ExistingWorkPolicy handling for unique work names, rather than simply allowing duplicate unique names to coexist?Framework
  91. Q91On Android 13+, an app in the RESTRICTED App Standby Bucket (due to user inactivity) enqueues a OneTimeWorkRequest with no constraints. What's the realistic execution behavior?Framework
  92. Q92What's the correct mental model for why a foreground service's android:foregroundServiceType="shortService" exists separately from other typed categories on Android 14?Framework
  93. Q93An app needs to retry a failed request with a refreshed auth token after a 401, ensuring concurrent requests don't each trigger their own token refresh. Which OkHttp mechanism is purpose-built for this?Data
  94. Q94A Room entity has a @Relation defining UserWithPosts (one User to many Posts). What does Room actually generate to populate this relation?Data
  95. Q95Which Room schema change CANNOT be handled by @AutoMigration and requires a manually written Migration?Data
  96. Q96In the single-source-of-truth offline-first pattern, what should a 'pull to refresh' action actually do?Data
  97. Q97An OkHttp response has Cache-Control: max-age=300 but the device just went offline and the cached entry is 600 seconds old. By default, what does OkHttp's cache do for a new request to the same URL?Data
  98. Q98Why is @Upsert generally preferred over @Insert(onConflict = OnConflictStrategy.REPLACE) when syncing server data into a Room table that has foreign-key relationships or triggers?Data
  99. Q99A Room DAO query joins three tables and is exposed as a Flow. A write happens to one of the three tables, completely unrelated in content to the rows currently shown by this query. What happens?Data
  100. Q100A ViewModel test using `StandardTestDispatcher` calls a suspend function on `viewModelScope.launch` but the resulting `StateFlow` never updates within the test body. What is the most likely missing step?Testing
  101. Q101Why does `composeTestRule.onNodeWithTag("loading_spinner").assertDoesNotExist()` sometimes pass immediately even though the spinner is still genuinely showing on a real device after the same code change?Testing
  102. Q102A team wants both speed and realism, so they keep Robolectric tests for most ViewModel+UI logic and a smaller Espresso/Compose-instrumented suite for a handful of screens. What is the most defensible technical reason for NOT eliminating the instrumented layer entirely?Testing
  103. Q103In a Compose UI test, `onNodeWithText("Submit")` fails to find a node even though a `Row { Icon(...); Text("Submit") }` is visibly rendered with a click modifier on the `Row`. What is the most likely cause?Testing
  104. Q104A ViewModel test fakes a repository's `Flow<Resource<Data>>` with `flowOf(Resource.Success(data))`. The test passes, but a production bug exists where rapid re-invocation of the loading function doesn't cancel the previous in-flight request. Why does this test fail to catch that bug?Testing
  105. Q105Which statement best describes how Espresso and Compose's testing framework differ in how they decide a UI is ready to be asserted on?Testing
  106. Q106A test class has multiple `@Test` methods, each using `Dispatchers.setMain(testDispatcher)` in a `@Before` method, but no corresponding reset. Tests pass individually but fail intermittently when the full suite runs. What is the most likely root cause?Testing
  107. Q107An app's Activity process is still alive but the Activity instance was destroyed by the system to reclaim memory. The user reopens the app and the system calls onCreate() again. What kind of start is this?Performance
  108. Q108An app never calls reportFullyDrawn(), but its first frame renders quickly with an empty list that fills in 800ms later via a network call. What does Play Console's Time to Full Display (TTFD) metric report for this launch?Performance
  109. Q109A library's Initializer in App Startup performs a blocking disk read inside create(), and the dependency graph places it before the app's own UI-critical initializer. What's the most direct consequence?Performance
  110. Q110What is the primary effect of a Baseline Profile, mechanically, on a freshly installed release APK?Performance
  111. Q111LeakCanary forces a garbage collection and then checks a KeyedWeakReference before deciding to take a heap dump. Why does it wait and force GC rather than dumping the heap immediately when a watched object (e.g. a destroyed Activity) is detected?Performance
  112. Q112A Composable launches GlobalScope.launch { ... } inside its body to perform a periodic background update, capturing a local MutableState in its closure. What's the core problem with this pattern?Performance
  113. Q113You want to validate that adding a Baseline Profile actually improved cold-start time, with realistic numbers that predict production behavior. Which Macrobenchmark setup is correct?Performance
  114. Q114An AES key is generated via KeyGenParameterSpec with setUserAuthenticationRequired(true) and setUserAuthenticationValidityDurationSeconds(30). What's the main security tradeoff of this configuration versus using -1 (per-operation auth bound to a CryptoObject)?Security
  115. Q115Why is BiometricPrompt's CryptoObject considered a stronger security boundary than checking a boolean "authentication succeeded" callback before manually decrypting data?Security
  116. Q116A network_security_config.xml in a release build includes <certificates src="user"/> in its trust-anchors. What's the concrete risk this introduces?Security
  117. Q117Why do most certificate pinning implementations pin the SHA-256 hash of the Subject Public Key Info (SPKI) rather than the full leaf certificate?Security
  118. Q118What does R8's obfuscation step actually rename, and what does it leave completely untouched that still poses a risk for embedded secrets?Security
  119. Q119A backend wants to verify that a request genuinely came from an unmodified, Play-distributed copy of the app running on a non-rooted device, with the verdict resistant to client-side tampering. Which approach best satisfies this?Security
  120. Q120A project has flavor dimensions `environment` (dev, staging, prod) and `tier` (free, paid), plus the standard debug/release build types. How many total build variants does Gradle generate?Gradle
  121. Q121Why does `buildSrc` tend to be more disruptive to build performance on large projects than a composite build (`includeBuild`) hosting the same convention plugins?Gradle
  122. Q122What does the Gradle build cache use as part of a task's cache key, beyond the task's declared `@Input`/`@InputFiles` values?Gradle
  123. Q123A custom Gradle task has no `@Input`/`@OutputFile` annotations on its properties. What is the direct consequence for build/configuration caching?Gradle
  124. Q124Why is KSP generally faster than kapt for processors like Room or Dagger/Hilt when available?Gradle
  125. Q125What specifically does enabling Gradle's configuration cache skip on a cache hit?Gradle
  126. Q126A sealed class hierarchy `Shape` has subtypes `Circle`, `Square`, and `Triangle`, all in the same module and package. A `when (shape) { is Circle -> ...; is Square -> ... }` expression used as a return value, with no `else` branch and `Triangle` unhandled, will:Kotlin
  127. Q127What is the primary reason `inline` functions improve performance for higher-order functions like a custom `measureBlock { ... }` timing utility?Kotlin
  128. Q128Given `inline fun <reified T> Any?.isInstanceOf(): Boolean = this is T`, why is `reified` required here instead of a plain type parameter `T`?Kotlin
  129. Q129`Delegates.vetoable(initial) { _, old, new -> new >= old }` is used as a property delegate for a `var score: Int`. What happens when code executes `score = score - 10`?Kotlin
  130. Q130`class CachingRepo(private val inner: Repo) : Repo by inner { override fun getUser(id: String) = cache.getOrPut(id) { inner.getUser(id) } }`. If `inner`'s own implementation of some other `Repo` method internally calls `this.getUser(id)` on itself, which `getUser` runs?Kotlin
  131. Q131Comparing `data.let { transform(it) }` and `data.run { transform(this) }` where `transform` only needs the value once and doesn't call other members of `data`, what's the most accurate statement?Kotlin
  132. Q132Why might a senior engineer flag heavy nesting of `run { ... run { ... } ... }` in code review even though both calls are inline and therefore allocate nothing extra?Kotlin
  133. Q133A nested Navigation Compose graph is used to scope a ViewModel across a 3-screen onboarding flow. Which back-stack entry should hiltViewModel() be called against to share that ViewModel across all three screens?Framework
  134. Q134A RemoteMediator's load() function for LoadType.APPEND returns MediatorResult.Success(endOfPaginationReached = true) after the very first network call, even though the API has more pages. What's the observable effect in the UI?Framework
  135. Q135Why is Preferences DataStore generally a poor fit once an app's settings model includes nested objects or enums with strict valid values?Framework
  136. Q136An ImageAnalysis.Analyzer in a CameraX pipeline runs ML Kit barcode detection that occasionally takes 300ms per frame on a slow device, and the developer never calls image.close(). What is the most likely symptom?Framework
  137. Q137In the standard Paging 3 network+database pattern, what does the UI layer's Pager actually page from when a RemoteMediator is configured?Framework
  138. Q138A bottom-navigation setup calls navigate(tabRoute) with launchSingleTop = true but without popUpTo/saveState. What problem can still occur?Framework
  139. Q139Why does CameraX typically cap concurrent use-case bindings (e.g. Preview + ImageCapture + ImageAnalysis) rather than allowing Preview, ImageCapture, ImageAnalysis, and VideoCapture all bound simultaneously on most devices?Framework
  140. Q140A modularized app has :feature:a and :feature:b both depending only on :core:network and :core:ui, with no edges between them. :app depends on both features. What does this graph shape primarily enable?Architecture
  141. Q141Why is overusing Gradle's `api` configuration (instead of `implementation`) for inter-module dependencies considered harmful to incremental build performance at scale?Architecture
  142. Q142:feature:cart needs to navigate to :feature:checkout, and :feature:checkout occasionally needs to navigate back to :feature:cart. Both are regular (non-dynamic) Gradle feature modules. What's the standard way to avoid a circular module dependency here?Architecture
  143. Q143A shared ViewModel is used to pass in-progress checkout state between :feature:cart and :feature:checkout. Where should that ViewModel's module live to actually preserve the modularization benefit?Architecture
  144. Q144Compose's strong-skipping mode (the default since Kotlin 2.0.20) lets composables with unstable parameters remain skippable by comparing them with referential equality (===) instead of .equals(). Given that, why does a shared model type defined without stability annotations or with a mutable collection field still hurt recomposition performance app-wide?Architecture
  145. Q145A team splits :feature:profile into :feature:profile:api (interfaces, navigation contracts) and :feature:profile:impl (UI, ViewModel, business logic), with other features depending only on :api. What's the main incremental-build benefit?Architecture
  146. Q146A Card composable wraps an Icon, a title Text, and a subtitle Text, with Modifier.clickable applied to the Card itself. What does TalkBack announce when the user swipes to focus it?Compose
  147. Q147Which API correctly observes live changes to the available window size as a user resizes a freeform desktop window or unfolds a foldable device, inside a composable?Compose
  148. Q148What does Modifier.clearAndSetSemantics { } do that plain Modifier.semantics { } does not?Compose
  149. Q149A team builds a custom toggle from a Box with Modifier.clickable and a manually drawn on/off indicator, but skips setting a Role. What does TalkBack announce, and why is that a problem?Compose
  150. Q150In a ListDetailPaneScaffold-based screen, what's the correct way to handle 'selected item' state so both the list and detail panes work correctly at every WindowSizeClass?Compose
  151. Q151Why is WindowSizeClass generally preferred over checking the device's physical screen size or model to decide adaptive layout behavior?Compose
  152. Q152A status Text composable updates from "Saving..." to "Saved" without regaining focus. What semantics property ensures TalkBack announces the change automatically?Compose
  153. Q153In Now in Android's multi-module setup, what actually enforces that feature:foryou can't accidentally import feature:bookmarks?Architecture
  154. Q154Now in Android generates its Baseline Profile using:Performance
  155. Q155Now in Android keeps the local Room database as the source of truth for offline-first data. What does the UI actually observe?Architecture
  156. Q156Jetsnack's cart animation choreographs several properties (offset, scale, alpha) changing together off one state enum. The right Compose primitive for that is:Compose
  157. Q157Adapting a phone-only list-detail screen (like Reply) to a two-pane tablet layout requires which state change?Compose
  158. Q158The core structural difference between an MVVM and MVI implementation of the same screen is:Architecture
  159. Q159MVI's single-UiState-plus-reducer shape specifically prevents:Architecture
  160. Q160Architecture Blueprints' MVVM and MVI branches share the same repository/data layer unchanged. That demonstrates:Architecture
  161. Q161AnkiDroid keeps its SM-2 spaced-repetition scheduling logic as plain Kotlin with no Android/Room dependency. The main benefit is:Architecture
  162. Q162AnkiDroid schedules review reminders that must fire even after the app process dies, using:Behavioral