Kotlin Multiplatform (KMP)
ADVANCED › Emerging
Sharing business logic, networking, and data across Android and iOS while choosing native or shared UI.
KMP comes up in interviews as the pragmatic way to reuse Kotlin code across Android, iOS, and beyond without rewriting an app. Interviewers test whether you know what genuinely belongs in shared code (logic, networking, models, persistence) versus native UI, how expect/actual and source sets work, and the real-world libraries (Ktor, SQLDelight, kotlinx.serialization). Senior signal is judgment: articulating when KMP pays off versus when its build and Swift-interop overhead outweighs the reuse.
What this covers
- What goes in commonMain (logic, networking, data models, persistence, ViewModels) vs native UI
- expect/actual declarations and the alternative of interfaces plus dependency injection
- Ktor Client engines and SQLDelight drivers configured per platform
- Source sets, the default hierarchy template, and Kotlin/Native vs Kotlin/JVM backends
- Kotlin-to-Swift interop limits: Objective-C framework, suspend functions, generics
- When KMP pays off versus the build, tooling, and debugging pain it adds
Study this topic
- Kotlin Multiplatform (KMP) explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Kotlin Multiplatform (KMP) interview questions and answers