Kotlin Ultimate Handbook

Learn Kotlin properly. From zero to interview ready.

by Saqib Razzaq

11 language topics 11 library guides Open source

Language

Core Kotlin concepts, taught from a Go background — read top to bottom if you're new
📖
Basics

val/var, type inference, string templates, when, ranges, loops, functions, default and named args.

val/varwhenRangesFunctions
🛡
Null Safety

?., ?:, !!, safe casts, smart casts, lateinit vs lazy, platform types, nullable collections.

?.?:Smart castslateinit
λ
Functions & Lambdas

Higher-order functions, lambda syntax, trailing lambdas, extension functions, inline, operator overloading.

LambdasExtensionsinline
🏛
Classes & Objects

Constructors, data classes, sealed classes, enums, object and companion object, delegation with by.

data classsealedobject
🧬
Generics

Type parameters, variance with in/out, star projection, reified type parameters, type erasure.

in/outreifiedErasure
📦
Collections

List/Set/Map, read-only vs mutable interfaces, construction, iteration, destructuring, Array vs List.

ListMapMutable vs read-only
🔀
Coroutines

suspend, launch/async, structured concurrency, scopes, dispatchers, cancellation, channels, Flow intro.

suspendlaunchScopes
🧪
Testing

kotlin.test and JUnit 5, parameterized tests, MockK basics, runTest for coroutines.

JUnit 5MockKrunTest
Java Interop

Calling Java from Kotlin, platform types, @JvmStatic/@JvmOverloads, SAM conversions, checked exceptions.

Platform types@Jvm*SAM
Performance

Inline functions, value classes, boxing on the JVM, sequences vs collections, tailrec, const.

inlinevalue classBoxing
⚠️
Gotchas

== vs ===, data class copy with var, mutable state behind read-only interfaces, non-local returns, and more.

==/===copyScope misuse