Kotlin — Interview questions
Android Architecture
Background work on Android — Services, WorkManager, and Doze restrictions.
10 questions
Android Platform Components
The Jetpack building blocks an Android app is assembled from — Navigation with its back stack and deep links, Room over raw SQLite, Parcelable versus Serializable, and View Binding after the removal of Kotlin synthetics.
6 questions
Boxing & Equality
Primitive vs boxed numbers, nullable types, the Integer cache, and reference equality.
4 questions
Build & Compiler Toolchain
What happens between source and APK — the K2 frontend, kapt versus KSP annotation processing, build variants, R8 shrinking and obfuscation, the Gradle Kotlin DSL, and multi-module layout for incremental build speed.
11 questions
Classes & Properties
The class mechanics behind everyday Kotlin — primary and secondary constructors, initializer order, open versus final inheritance, the internal visibility modifier, nested versus inner classes, backing fields, and default methods on interfaces.
8 questions
Collections & Sequences
The standard-library collection API — map, filter and flatMap transformations, eager List versus lazy Sequence evaluation, read-only versus mutable collections at runtime, fold versus reduce, groupBy versus associateBy, and arrays including the primitive IntArray family.
9 questions
Jetpack Compose
Declarative UI in Kotlin — how composition differs from the imperative View system, recomposition and what triggers an unnecessary one, remember versus a plain local variable, Compose Multiplatform, and Compose Hot Reload.
7 questions
Concurrency
Threads, synchronized monitors, deadlocks, the Java Memory Model, and memory leaks.
6 questions
Coroutine Cancellation & Failure
How a coroutine tree stops and how failure propagates — the Job hierarchy, cooperative cancellation and yield, SupervisorJob and supervisorScope, where CoroutineExceptionHandler actually catches, and cancellation-safe cleanup with finally and NonCancellable.
9 questions
Coroutines
Suspending computation on the JVM — how a coroutine differs from a thread, suspend as continuation passing, the launch/async/runBlocking builders, structured concurrency and CoroutineScope, CoroutineContext, the Main/IO/Default dispatchers, and Mutex instead of synchronized.
21 questions
Custom Views
The Android custom-view lifecycle — onMeasure, onLayout, onDraw, and MeasureSpec.
3 questions
Data Classes
Data classes, generated equals/hashCode/copy, and their use as map keys.
8 questions
Delegation
Interface delegation with by, delegated properties, and override precedence.
4 questions
Dependency Injection
Dependency injection with Dagger 2 — components, modules, bindings, and multibinding.
4 questions
Error Handling
How Kotlin reports failure — the Result type and runCatching, the deliberate absence of checked exceptions, and when to model an expected error as a return value instead of throwing.
6 questions
Flow & Channels
Asynchronous streams in kotlinx.coroutines — cold Flow versus hot SharedFlow and StateFlow, operators, backpressure with buffer, conflate and collectLatest, why flowOn only affects upstream, and when a Channel beats a Flow.
11 questions
Functions & Lambdas
Kotlin as a functional language — higher-order functions, function types, lambdas with a receiver and the builder DSLs they enable, trailing-lambda syntax, local functions, tailrec, operator overloading, and extension functions and properties.
13 questions
Kotlin Fundamentals
The everyday syntax layer — val versus var, expression-oriented if and when, string templates, Unit, the Any hierarchy, default and named arguments, top-level functions, and the scope functions let/run/with/apply/also.
12 questions
Generics
Type erasure, reified type parameters, and variance in Kotlin generics.
7 questions
Inline Functions
Inline functions, non-local return, and the crossinline and noinline modifiers.
5 questions
Java Interop
Where the two languages meet — platform types from unannotated Java, @JvmStatic, @JvmOverloads and @JvmName, @Throws, how Kotlin declarations map to bytecode, calling a suspend function from Java, and the places 100% interop actually leaks.
12 questions
Kotlin Multiplatform
Sharing Kotlin across targets — expect/actual declarations, common and platform source sets, the klib format, iOS interop through the Objective-C header and the alpha Swift export, the Native memory model, Kotlin/Wasm, the KMP library ecosystem, and adoption strategy.
18 questions
Null Safety
How the type system removes NullPointerException — nullable types, the safe call and Elvis operators, the not-null assertion, smart casts and when they are allowed, lateinit, and the Nothing type.
7 questions
Sealed Hierarchies & Objects
Closed type hierarchies and the object family — sealed classes and interfaces, exhaustive when, object declarations as singletons, companion objects instead of static members, and anonymous objects.
9 questions
Testing
Testing Kotlin code — the JUnit and Kotest frameworks, runTest for suspending code, MockK against final classes and extension functions, fakes versus mocks, Turbine for Flow emissions, Compose snapshot tests, instrumented versus local JVM tests, KMP commonTest, and property-based testing.
11 questions