More in Mobile Dev — page 33
Managing Sensitive Information in Gradle Builds
Tests secure credential handling in Android builds. A good answer uses a git-ignored `.properties` file, the `secrets-gradle-plugin` to parse it, and accesses keys via `BuildConfig`. A red flag is storing keys directly in `build.gradle` or committing them.

How do you diagnose a memory leak using the Android Studio Profiler?
This tests your practical skill with the Android Memory Profiler, not just theory. A great answer involves capturing a heap dump, filtering for unreachable objects, and inspecting the reference tree to find the leak's source.

Explain Gradle Build Types vs. Product Flavors
Tests your grasp of Gradle's build matrix. A great answer defines build types for lifecycle (debug/release) and product flavors for user-facing versions (free/paid), then explains how they combine into variants.

What is ADB and what are two common commands you use?
Tests your hands-on familiarity with the core Android toolchain. Define ADB's client-server architecture, then explain `adb install` for APKs and `adb logcat` for logs. A red flag is being unable to name specific commands or only knowing IDE buttons.

Which tool inspects the view hierarchy to debug layouts?
This tests your knowledge of core Android Studio debugging tools. A great answer names the Layout Inspector, describes its 3D component tree and attributes pane, and notes its live update capability on API 29+. A red flag is only mentioning XML files.

What is a Gradle product flavor?
This tests your understanding of build variants beyond debug/release. Define flavors for user-facing versions (free/pro), contrast with build types, and configure with `applicationIdSuffix` and `buildConfigField`.

How would you debug an app crash in Android Studio?
This tests your systematic debugging process. A good answer starts with Logcat to find the stack trace, then uses breakpoints to inspect program state *before* the crash occurs. A red flag is randomly adding print statements instead of using the debugger.

What is the `res/` directory and how do you use resource qualifiers?
This tests your grasp of Android's resource system. Explain that `res/` separates assets from code and that qualifiers (e.g., `layout-land`) let the OS pick the right layout. A red flag is checking orientation manually in code instead of using this system.

Difference between project and module build.gradle files?
This tests your understanding of Gradle's project structure and build configuration scope. The project-level file configures global settings like repositories, while the module-level file configures specifics like dependencies and app ID.

Purpose and Key Elements of AndroidManifest.xml
Tests if you know the manifest is the app's contract with the Android OS. A good answer defines its role and lists key elements like activities, permissions, and the launcher intent. A red flag is calling it just a generic 'config file'.

Implement a type-safe DSL for a UI component in Kotlin
This tests your ability to design clean, hierarchical APIs using Kotlin's idiomatic features. A great answer defines model classes, then uses higher-order functions with lambdas with receiver to create a nested structure, and mentions `@DslMarker` for scope…

What is a reified type parameter in Kotlin?
Tests your grasp of JVM type erasure and Kotlin's solution. Explain that `reified` makes a generic type accessible at runtime inside an `inline` function, avoiding manual `Class` passing. A red flag is failing to link `reified` directly to `inline` functions.

How does coroutine cancellation work internally?
Tests your grasp of cooperative cancellation. A good answer explains that `cancel()` sets a flag, `suspend` functions check it and throw `CancellationException`, and non-suspending loops need manual `isActive` checks.

Explain backpressure in Kotlin Flows and its management operators
This tests your understanding of Flow's pull-based nature and performance tuning. A great answer defines suspension as the default backpressure, then details how `buffer`, `conflate`, and `collectLatest` optimize it.

Explain Kotlin's declaration-site variance with `in` and `out`
This tests your grasp of type systems and API design. Explain how `out` (covariance/producer) and `in` (contravariance/consumer) provide type safety at the declaration site, simplifying usage. A red flag is confusing variance with immutability.

What is a CoroutineDispatcher and when do you use each type?
Tests your grasp of coroutine threading. A dispatcher manages which threads a coroutine runs on. Explain `Main` for UI, `Default` for CPU-intensive work, and `IO` for blocking operations. A red flag is mixing up `IO` and `Default` or using `Unconfined`.

Hot vs. Cold Streams: `StateFlow` vs. `Flow`
Tests your grasp of stream lifecycles. A great answer defines cold `Flow` (lazy, per-collector) vs. hot `StateFlow` (shared, active), then uses a ViewModel UI state scenario to show why `StateFlow` is correct for surviving configuration changes.

Structured Concurrency in Kotlin Coroutines
Tests your understanding of coroutine lifecycles and error handling. A good answer defines the parent-child relationship, then explains how cancellation and exceptions propagate through the scope. A red flag is simply calling it a way to 'group' coroutines.

Explain Kotlin's scope functions: let, run, with, apply, also
This tests your grasp of idiomatic Kotlin and the two key differentiators: context object (`this`/`it`) and return value (object/lambda result). A great answer defines these axes, categorizes each function, and provides a clear example.

What is a `suspend` function in Kotlin?
Tests your grasp of Kotlin's core concurrency primitive. A `suspend` function can pause and resume. It must be called from another suspend function or a coroutine builder.