Skip to content
tezvyn:

Android & Kotlin

Jetpack Compose, Android Studio, Kotlin, Material You

194 bites

Test yourself: Top 30 intermediate Android & Kotlin interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Intermediate everything in Android & Kotlin, page 5

Android Style vs. Theme and Attribute Resolution
intermediate2 min read

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.

Static vs. Dynamic BroadcastReceivers: Implications & Restrictions
intermediate2 min read

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?
intermediate2 min read

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.

Describe the back stack for A -> B -> C with singleTask
intermediate2 min read

Describe the back stack for A -> B -> C with singleTask

Tests understanding of the singleTask launch mode. A great answer explains that launching C destroys B, as singleTask clears all activities above it in the task. The final back stack becomes [A, C]. A red flag is confusing this with singleTop.

How does a ViewModel survive configuration changes?
intermediate2 min read

How does a ViewModel survive configuration changes?

Tests understanding of lifecycle-aware components. ViewModels are retained by a ViewModelStore owned by the Activity/Fragment, which survives configuration changes. The ViewModel is cleared only when its scope is permanently finished.

What is ADB and what are two common commands you use?
intermediate2 min read

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?
intermediate2 min read

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?
intermediate2 min read

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?
intermediate2 min read

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.

Explain Kotlin's declaration-site variance with `in` and `out`
intermediate2 min read

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?
intermediate2 min read

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`
intermediate2 min read

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
intermediate2 min read

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 and implement a higher-order function in Kotlin
intermediate2 min read

Explain and implement a higher-order function in Kotlin

Tests your grasp of functions as first-class citizens. Define a higher-order function, explain it takes/returns functions, then implement filterAndTransform using the specified lambdas.

lateinit var vs. val by lazy in Android
intermediate2 min read

lateinit var vs. val by lazy in Android

Tests your grasp of Kotlin's non-nullable property initialization. Define lateinit (mutable, framework-init) vs. lazy (immutable, deferred-init). Use lateinit for Views in onCreate and lazy for expensive objects. Red flag: confusing their mutability.

What are the advantages of a Kotlin data class?
intermediate2 min read

What are the advantages of a Kotlin data class?

Tests knowledge of Kotlin's boilerplate reduction for data holders. A good answer defines the advantage (conciseness), names generated functions like equals, hashCode, and copy, and explains copy for immutable state updates.

What is a Kotlin extension function? Write one for String.
intermediate2 min read

What is a Kotlin extension function? Write one for String.

Tests your grasp of adding functionality to existing classes without inheritance. A great answer defines it as syntactic sugar over static methods, explains its use for third-party code, then implements the requested String.hasWhitespace function.

Why is `LiveData<Boolean>` bad for one-time ViewModel events?
intermediate2 min read

Why is `LiveData<Boolean>` bad for one-time ViewModel events?

This tests your grasp of state vs. events. A LiveData<Boolean> is state; it re-triggers on rotation. Instead, expose events via a StateFlow and have the UI call an eventConsumed() function on the ViewModel to maintain unidirectional data flow.

Implement an efficient list in Jetpack Compose
intermediate2 min read

Implement an efficient list in Jetpack Compose

Tests your grasp of UI virtualization in Compose. Answer: Use LazyColumn as it only composes visible items. Contrast this with Column, which composes all items at once, causing poor performance. Mention the items DSL.

Which side-effect handler for a one-time coroutine action in Compose?
intermediate2 min read

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.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles