Skip to content
tezvyn:

Android & Kotlin

Jetpack Compose, Android Studio, Kotlin, Material You

66 bites

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

Advanced interview questions in Android & Kotlin

When would you use a sealed class instead of an enum?
advanced2 min read

When would you use a sealed class instead of an enum?

This tests closed hierarchies versus singleton constants. A strong answer contrasts enums with sealed class instances, shows a NetworkResult example with data-bearing branches, and highlights exhaustiveness.

When would you use a sealed class instead of an enum?
advanced2 min read

When would you use a sealed class instead of an enum?

This tests your understanding of state representation. Explain that sealed classes define a hierarchy of types that can hold different data, while enums are a set of singleton constants.

When to use a sealed class instead of an enum?
advanced2 min read

When to use a sealed class instead of an enum?

Tests your grasp of Kotlin's type hierarchies. Use sealed class for states with associated data (e.g., Success(data)), as subclasses can have unique properties. Use enum for simple, constant states. A red flag is treating them as interchangeable.

Compare Kotlin apply and let scope functions
advanced2 min read

Compare Kotlin apply and let scope functions

Apply uses this and returns receiver for configuration; let uses it and returns lambda result for null-safe transforms.

Compare and contrast Kotlin's `apply` and `let` scope functions
advanced2 min read

Compare and contrast Kotlin's `apply` and `let` scope functions

This tests your grasp of idiomatic Kotlin scope functions. apply uses this and returns the object, ideal for configuration. let uses it and returns the lambda result, useful for null-safe chaining.

Compare and contrast `apply` and `let` scope functions
advanced2 min read

Compare and contrast `apply` and `let` scope functions

Tests Kotlin scope function knowledge: context (this/it) & return value. apply uses this, returns the object (for config). let uses it, returns lambda result (for null-checks/transforms). Red flag: mixing up return values or use cases.

What does inline solve for higher-order functions, and what is reified?
advanced2 min read

What does inline solve for higher-order functions, and what is reified?

It tests lambda overhead and type erasure. Answer: inline flattens lambdas into call sites to remove allocation and virtual calls; reified needs inline so the compiler knows the concrete type at the call site, enabling is T checks.

Explain `inline` and `reified` in Kotlin
advanced2 min read

Explain `inline` and `reified` in Kotlin

Tests your grasp of JVM performance costs and type erasure. A great answer explains how inline avoids object allocation for lambdas, and how this enables reified to bypass type erasure for runtime checks. A red flag is just saying 'it's for performance'.

What problem does `inline` solve, and how does `reified` relate?
advanced2 min read

What problem does `inline` solve, and how does `reified` relate?

This tests your grasp of Kotlin compiler optimizations and JVM type erasure. Explain that inline eliminates the runtime overhead of lambda objects. Then, describe how reified leverages inlining to make generic types accessible at runtime.

advanced2 min read

How do buffer, conflate, and collectLatest manage Kotlin Flow backpressure?

Backpressure is fast emit vs slow collect; buffer() suspends the producer when full, conflate() drops stale values, and collectLatest() cancels active collection to…

Explain backpressure in Kotlin Flows and its management operators
advanced3 min read

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 backpressure in Kotlin Flows and its management operators
advanced2 min read

Explain backpressure in Kotlin Flows and its management operators

This tests your understanding of Flow's sequential nature and strategies for decoupling producers and consumers. Explain default suspension, then detail buffer(), conflate(), and collectLatest(). A red flag is confusing conflate() with collectLatest().

Describe coroutine cancellation mechanics and cooperative suspend functions
advanced2 min read

Describe coroutine cancellation mechanics and cooperative suspend functions

Tests cooperative cancellation mechanics. cancel() sets a Job to cancelling; suspend functions check this at suspension points and throw CancellationException, yet a tight non-suspending loop never checks and keeps running.

How does coroutine cancellation work internally?
advanced2 min read

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.

How does coroutine cancellation work internally?
advanced2 min read

How does coroutine cancellation work internally?

This tests your grasp of cooperative cancellation. Explain that cancel() sets a flag, causing a CancellationException at the next suspension point. A non-suspending loop must explicitly check isActive to stop.

What is a reified type parameter in Kotlin?
advanced2 min read

What is a reified type parameter in Kotlin?

Tests JVM type erasure and inline function mechanics. Strong answer: reified preserves generic types at runtime via inline expansion, enabling is T checks without Class<T> passing. Red flag: claiming reified works without inline or outside functions.

What is a reified type parameter in Kotlin?
advanced2 min read

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.

Explain Kotlin's `reified` type parameters and their use case
advanced2 min read

Explain Kotlin's `reified` type parameters and their use case

Tests your grasp of JVM type erasure and Kotlin's solution. A great answer defines reified as making a generic type's Class accessible at runtime, explains this requires an inline function to substitute the type at the call site, and shows an example.

How would you implement a type-safe Kotlin DSL for a UI Form?
advanced2 min read

How would you implement a type-safe Kotlin DSL for a UI Form?

Tests Kotlin DSL scoping with lambda receivers and extensions. Strong answers sketch a Form builder using initTag, explain T.() -> Unit implicit this for child elements, and add DslMarker to block scope leaks. Red flag: describing it as simple method chaining.

Implement a type-safe DSL for a UI component in Kotlin
advanced2 min read

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…

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