Kotlin Multiplatform (KMP) Interview Questions

ADVANCED › Emerging

What is Kotlin Multiplatform, and how is it different from Flutter or React Native?

What a strong answer covers: KMP lets you share Kotlin code (business logic, data, networking, and optionally UI with Compose Multiplatform) across Android, iOS, desktop and web, while each platform can keep its native UI. Flutter and React Native share the UI layer with their own rendering or bridge and a different language. KMP can be adopted gradually, sharing as much or as little as you want.

What are expect and actual declarations?

What a strong answer covers: In common code you declare expect fun or expect class for something that needs a platform implementation, and each platform source set provides the actual implementation, like a UUID generator, a database driver, or date formatting. Often an interface in common code with platform implementations injected through DI is simpler and easier to test.

Which libraries would you use to build the shared layer of a KMP app?

What a strong answer covers: Ktor for networking, kotlinx.serialization for JSON, kotlinx.coroutines and Flow for concurrency, SQLDelight or Room (now multiplatform) for databases, DataStore for preferences, Koin or kotlin-inject for DI, kotlinx-datetime for dates, and Compose Multiplatform if sharing UI. Skie or KMP-NativeCoroutines improve how Flow and suspend functions look from Swift.

What are the challenges of exposing shared Kotlin code to iOS developers?

What a strong answer covers: Kotlin compiles to an Objective-C framework, so Swift sees suspend functions as completion handlers or async functions, Flow isn't natively consumable, sealed classes aren't Swift enums, generics are limited and default arguments disappear. Tools like SKIE help. There's also build time on Xcode, debugging Kotlin from Xcode, memory model differences (now improved), and getting iOS developers to own shared code.

Your company has separate Android and iOS apps and wants to try KMP. How would you introduce it with low risk?

What a strong answer covers: Start with a small, self-contained, logic-heavy piece both apps duplicate, such as validation rules, a pricing calculator, analytics event definitions or an API client, in a shared module published to iOS as an XCFramework through Swift Package Manager or CocoaPods. Keep the UI native. Involve the iOS team early, measure build impact and bugs fixed once, set up CI for both, and expand only if it pays off.

Back to Kotlin Multiplatform (KMP)