Kotlin interview essentials
The Kotlin topics interviews ask about most: null safety, special class types, scope functions, coroutines and Flow.
⬜⬜⬜⬜⬜
1. val/var, null safety & the type system
kotlintheory
2. data, sealed, object, enum — when to use which
kotlintheory
3. Scope functions & extension functions
kotlin
4. Coroutines: suspend, scopes, dispatchers
kotlinconcurrency
5. Flow, StateFlow, SharedFlow — hot vs cold
kotlinconcurrency
🎯 Stage assignment
Stage project — "the bank domain in Kotlin" (2-3 hours).
In Kotlin Playground or an empty project, write a single file containing:
Account,CardandTransactionmodels —data classes with deliberate nullability.- A
sealed interface TransferResultand an exhaustivewhenhandling it. - Two
suspendfunctions (balance + history), called in parallel withasyncand timed. - A simple "ViewModel" simulation with
MutableStateFlow<UiState>: state transitions viaupdate { it.copy(...) }. - One extension function (
maskPan) and a few scope functions.
Done when: the file runs and every construct carries a "why I chose this" comment. This file becomes your reference point in later stages.