Skip to content

AAD Practice Questions

Prepare for AAD with more than an answer.

181 questions in the full set20 sample questionsUpdated Aug 11, 2025
Exam fee
$149 USD
Level
Associate
Valid for
3 years
Domains covered on the exam 5
  1. Android Core20%
  2. User Interface25%
  3. Data Management20%
  4. Debugging15%
  5. Testing20%
  1. 1

    A developer is using the Layout Inspector in Android Studio to debug a Jetpack Compose UI. They want to understand why a specific composable is recomposing frequently. Which feature of the Layout Inspector is specifically designed for this purpose?

    Show answer details

    Correct answer: D

    The Layout Inspector has a specific feature to track and display recomposition counts for each composable in real-time. By enabling this, a developer can interact with the app and see exactly which composables are recomposing and which are being skipped, making it the primary tool for diagnosing performance issues related to unnecessary recompositions.

  2. 2

    To define a test method in a local unit test using JUnit 4, which annotation must be placed directly before the function declaration?

    Show answer details

    Correct answer: A

    The @Test annotation from the org.junit.Test package is used to mark a public function as a test case that the JUnit test runner should execute.

  3. 3

    An app's Room database is being updated from version 1 to version 2. The update involves adding a new non-null column last_updated to an existing products table. If a migration strategy is NOT provided, what will happen when a user with the version 1 database updates the app to the version that uses the version 2 database?

    Show answer details

    Correct answer: A

    When Room detects a schema version mismatch and no migration path is provided, it will throw an IllegalStateException to prevent data corruption. The error message will explicitly state that a migration is missing. This is the default, safe behavior.

  4. 4

    In Jetpack Compose, what is the key difference between using LaunchedEffect and rememberCoroutineScope to launch a coroutine in response to a user action, such as a button click?

    Show answer details

    Correct answer: B

    This correctly identifies the fundamental difference. LaunchedEffect is itself a composable and is used to run suspend functions in response to lifecycle events or state changes. rememberCoroutineScope is a hook that provides a CoroutineScope that can be used in non-composable contexts, like event handlers (onClick), to launch coroutines that are still scoped to the composition.

  5. 5

    True or False: Starting with Android 8.0 (API 26), an app can no longer register most implicit broadcast receivers in its manifest file.

    Show answer details

    Correct answer: A

    True. To improve system performance and battery life, Android 8.0 (API 26) placed significant restrictions on what apps can do in the background. One of these restrictions was that apps can no longer use their manifest to register a receiver for most implicit broadcasts (broadcasts not specifically targeted at the app). Apps must instead use Context.registerReceiver() to register a receiver at runtime, which is tied to the lifecycle of a component.

  6. 6

    In a Jetpack Compose UI test, how would you find a specific Button composable that has been marked for testing and then assert that it is displayed on the screen?

    Show answer details

    Correct answer: B

    This is the correct and idiomatic way. You first add a Modifier.testTag("submit_button") to the Button composable in your app code. Then, in your test, you use the onNodeWithTag finder to locate the node and chain an assertion like assertIsDisplayed().

  7. 7

    When defining a table for a Room database, which annotation is used to mark a class as a database entity?

    Show answer details

    Correct answer: D

    The @Entity annotation is used to mark a data class as a table in the Room database. Room will create a table based on the properties defined in this class.

  8. 8

    A junior developer is building a Jetpack Compose screen that displays a list of user profiles. They've noticed that whenever a single profile's 'like' status changes, the entire list recomposes, causing performance issues. The senior developer suggests using 'state hoisting'. What is the primary goal of state hoisting in this context?

    Show answer details

    Correct answer: A

    State hoisting is a pattern of moving state up the composable tree to make child composables stateless. By doing this, the child composable (e.g., a single profile item) becomes dependent only on the inputs it receives. The state (like the 'like' status) is held by the parent, which can then decide to recompose only the specific child whose data has changed, rather than the entire list. This prevents unnecessary recompositions and improves performance.

  9. 9

    An application uses a Room database with a DAO that returns a Flow > to observe data changes. The UI layer collects this flow, but under heavy database write loads, the UI freezes because it's receiving updates too frequently. Which Flow operator is the most appropriate solution to apply before collecting the flow in the UI layer to mitigate this issue without losing the final state?

    Show answer details

    Correct answer: C

    conflate() is designed for this exact scenario. When the collector is busy and cannot process an emission, conflate ensures that intermediate values are dropped, but the most recent value is always buffered and delivered to the collector as soon as it's ready. This prevents the collector from being overwhelmed while guaranteeing the UI eventually reflects the latest state.

  10. 10

    A developer needs to schedule a background task using WorkManager that should only run when the device has a certain level of battery and is connected to a Wi-Fi network. Which of the following constraints should be applied to the WorkRequest? (Select TWO)

    Show answer details

    Correct answer: A, B

    This constraint ensures the work will only run when the device is on an unmetered network, which is typically Wi-Fi. This correctly addresses one of the requirements.

    This constraint defers the work until the device's battery is not considered low. This fulfills the requirement related to battery level.

Create an account to continue.