CodeBlanks Logo Icon CodeBlanks
Free 4 levels Kotlin

Kotlin

Learn Kotlin 2.x from null safety, OOP, coroutines, Flow to Ktor and Kotlin Multiplatform with hands-on projects.

The Kotlin course covers all levels with null safety, OOP, generics, coroutines, Flow, Ktor, Exposed, KSP and Kotlin Multiplatform.

  • 362 lessons
  • 30 h 24 min
  • 10 projects

No account needed, you can start right away. To save your progress, create a free account

Levels

The Kotlin course goes from zero to expert in four levels. Start at any level you like.
Not sure of your level? Take the placement test
Beginner

Learn Kotlin 2.x fundamentals: val/var, data types, loops, collections, functions and null safety.

  • Kotlin basics
  • Variables
  • Data types
  • Operators
116 lessons · 9 h 26 min See lessons →
Intermediate

Learn OOP, inheritance, data class, sealed class, extension functions, generics and higher-order functions in Kotlin.

  • Classes in depth
  • Inheritance
  • Data class
  • Sealed class
116 lessons · 9 h 58 min See lessons →
Advanced

Learn coroutines in depth, Flow, Ktor, kotlinx.serialization, Exposed and DI in Kotlin.

  • Advanced coroutines
  • Advanced Flow
  • Ktor HTTP client
  • Ktor server
83 lessons · 7 h 0 min See lessons →
Expert

Learn compile-time safety, KSP/KAPT, compiler plugins, Kotlin/Native, Kotlin Multiplatform and Compose Multiplatform in Kotlin.

  • Compile-time safety
  • KSP and KAPT
  • Compiler plugin
  • Kotlin/Native
47 lessons · 4 h 0 min See lessons →

Projects you will build

At every level you combine what you learned into a real page.

How does it work?

Short explanation

Each lesson explains one concept in a few short cards; no long videos or walls of text.

Try it right away

Multiple choice, fill-in-the-blank and matching exercises lock in what you just learned.

Write it yourself

You write real code in the in-browser editor; it is checked instantly and you see the result live.

Curriculum

62 groups · 362 lessons · 30 h 24 min

Learn Kotlin 2.x fundamentals: val/var, data types, loops, collections, functions and null safety.

1
Kotlin basics
6 lessons · 24 min
  1. 1 What is Kotlin? Learn that Kotlin is a modern JVM-based language. 4 min
  2. 2 Your first program Learn to write your first Kotlin program with fun main and println. 4 min
  3. 3 The main function Learn the fun main(args: Array<String>) structure. 4 min
  4. 4 Comments Learn to write // and /* */ comments in Kotlin. 3 min
  5. 5 String templates Learn to embed variables in strings with \$ and \${}. 4 min
  6. 6 Summary - Kotlin basics Combine main, println and comments to write your first Kotlin program. 5 min
2
Variables
6 lessons · 27 min
  1. 1 val and var Learn to declare variables with val (immutable) and var (mutable). 4 min
  2. 2 Type inference Learn type inference and explicit type declarations. 4 min
  3. 3 const Learn to define compile-time constants with const val. 4 min
  4. 4 lateinit Learn deferred initialization with lateinit var. 5 min
  5. 5 by lazy Learn lazy initialization with by lazy. 5 min
  6. 6 Summary - Variables Combine val, var, const and lateinit to write a profile program. 5 min
3
Data types
6 lessons · 25 min
  1. 1 Integer types Learn Int, Long, Short and Byte types. 4 min
  2. 2 Floating-point types Learn Double and Float types. 4 min
  3. 3 Boolean and Char Learn Boolean and Char types. 3 min
  4. 4 String Learn the String type and its methods. 4 min
  5. 5 Any and Unit Learn Any and Unit types. 5 min
  6. 6 Summary - Data types Combine Int, Double, String and Boolean to write a calculation card. 5 min
4
Project: CalculatorProject
5 lessons · 30 min
  1. 1 Project design Design the structure of the calculator project and write the skeleton code. 6 min
  2. 2 Add and subtract Add and test the addition and subtraction functions. 6 min
  3. 3 Multiply and divide Add multiplication, division and the divide-by-zero check. 6 min
  4. 4 Error handling Safely catch invalid inputs with try/catch. 6 min
  5. 5 Putting it together Combine all parts into a working calculator. 6 min
5
Operators
6 lessons · 26 min
  1. 1 Arithmetic operators Learn arithmetic with +, -, *, / and %. 4 min
  2. 2 Assignment operators Learn shortcut assignments with =, +=, -=, *=, /= and ++/--. 4 min
  3. 3 Comparison operators Learn to compare values with ==, !=, <, >, <= and >=. 4 min
  4. 4 Logical operators Learn boolean logic with &&, || and !. 4 min
  5. 5 Elvis operator Learn the Elvis operator with ?: and null safety. 5 min
  6. 6 Summary - Operators Combine arithmetic, logical and Elvis operators to build a grade calculator. 5 min
6
Strings
6 lessons · 28 min
  1. 1 Creating strings Learn to create strings and use the length property. 4 min
  2. 2 String templates Learn string templates with \$ and \${}. 5 min
  3. 3 String methods Learn uppercase, lowercase and trim methods. 4 min
  4. 4 substring Learn to take parts of a string with substring. 5 min
  5. 5 split and replace Learn string processing with split and replace. 5 min
  6. 6 Summary - Strings Combine templates, methods and split to write a business card. 5 min
7
Conditionals
6 lessons · 28 min
  1. 1 The if statement Learn how to check a condition with if. 4 min
  2. 2 else and else if Learn else and else if chains for alternative cases. 4 min
  3. 3 if expression Learn to use if as an expression in Kotlin. 5 min
  4. 4 when Learn multi-way selection with when. 5 min
  5. 5 when expression Learn to use when as an expression. 5 min
  6. 6 Summary - Conditionals Combine if, if expression and when to write a day-of-week app. 5 min
8
Loops
6 lessons · 26 min
  1. 1 The for loop Learn to write counted loops with for. 4 min
  2. 2 The while loop Learn loops that run while a condition holds with while. 4 min
  3. 3 The do-while loop Learn loops that run at least once with do-while. 4 min
  4. 4 Range Learn ranges with 1..10 and until/downTo. 5 min
  5. 5 break and continue Learn to exit a loop with break and skip with continue. 4 min
  6. 6 Summary - Loops Combine for, while and range to write a multiplication table. 5 min
9
Project: Shopping cartProject
5 lessons · 30 min
  1. 1 Cart design Design the data class structure for the shopping cart. 6 min
  2. 2 Adding items Learn to add items with the addItem function. 6 min
  3. 3 Calculating totals Learn to compute the subtotal and the tax-inclusive total. 6 min
  4. 4 Listing the cart Write the function that prints the cart formatted. 6 min
  5. 5 Putting it together Combine the cart functions with a menu loop. 6 min
10
Arrays
6 lessons · 28 min
  1. 1 Creating arrays Learn to create arrays with arrayOf and intArrayOf. 4 min
  2. 2 Array access Learn to access array elements by index. 4 min
  3. 3 Array size Learn array info with size and indices. 5 min
  4. 4 Array loop Learn to iterate over arrays with for. 5 min
  5. 5 Array methods Learn array processing with map, filter and forEach. 5 min
  6. 6 Summary - Arrays Combine arrayOf, size and map to write a class list. 5 min
11
Lists
6 lessons · 29 min
  1. 1 Creating lists Learn to create lists with listOf and mutableListOf. 4 min
  2. 2 List operations Learn list management with add, remove and contains. 5 min
  3. 3 List access Learn list access with get, indexOf and subList. 5 min
  4. 4 List iteration Learn to iterate over lists with for and forEach. 5 min
  5. 5 List methods Learn list processing with map, filter and sortedWith. 5 min
  6. 6 Summary - Lists Combine mutableListOf, add and map to write a class list. 5 min
12
Maps and Sets
6 lessons · 30 min
  1. 1 Creating sets Learn to create sets with setOf and mutableSetOf. 5 min
  2. 2 Set operations Learn set management with add, remove and contains. 5 min
  3. 3 Creating maps Learn to create maps with mapOf and mutableMapOf. 5 min
  4. 4 Map operations Learn map management with put, get and remove. 5 min
  5. 5 Map iteration Learn to iterate over maps with for. 5 min
  6. 6 Summary - Maps and Sets Combine Set and Map to write a phone book. 5 min
13
Functions
6 lessons · 28 min
  1. 1 Defining functions Learn to define functions with fun. 4 min
  2. 2 Return values Learn to return a value from a function with return. 4 min
  3. 3 Expression body Learn to write expression-body functions with =. 5 min
  4. 4 Default parameters Learn to define parameters with default values. 5 min
  5. 5 Named arguments Learn to call functions with named arguments. 5 min
  6. 6 Summary - Functions Combine expression body, default and named arguments to write a math helper. 5 min
14
Null safety
6 lessons · 30 min
  1. 1 Nullable types Learn String? and nullable types. 5 min
  2. 2 ?, !! and ?: Learn safe call, non-null assertion and Elvis operators. 5 min
  3. 3 let Learn null-safe blocks with let. 5 min
  4. 4 Null check Learn null checking with if (x != null). 5 min
  5. 5 lateinit Learn deferred initialization with lateinit var. 5 min
  6. 6 Summary - Null safety Combine ?, !!, ?: and let to write a null-safe function. 5 min
15
Project: To-do CLIProject
5 lessons · 30 min
  1. 1 Task model Design the Task data class and list structure. 6 min
  2. 2 Adding tasks Learn to add tasks with the addTask function. 6 min
  3. 3 Listing tasks Learn to print tasks formatted with listTasks. 6 min
  4. 4 Completing tasks Learn to update task status with completeTask. 6 min
  5. 5 Putting it together Build a working CLI app with a menu loop. 6 min
16
Advanced string operations
6 lessons · 30 min
  1. 1 Regex Learn regular expressions with Regex. 5 min
  2. 2 matches and find Learn regex search with matches and find. 5 min
  3. 3 replace Learn replacement with replace and lambda. 5 min
  4. 4 StringBuilder Learn efficient string concatenation with StringBuilder. 5 min
  5. 5 trim and pad Learn formatting with trim, padStart and padEnd. 5 min
  6. 6 Summary - Advanced strings Combine Regex, StringBuilder and trim to write a CSV parser. 5 min
17
Enums
6 lessons · 28 min
  1. 1 enum class Learn to define named constants with enum class. 4 min
  2. 2 Enum values Learn to access enum members and their values. 4 min
  3. 3 Enum properties Learn to define properties and methods in enums. 5 min
  4. 4 when with enum Learn branching on enums with when. 5 min
  5. 5 Enum and range Learn ranges and iteration with enums. 5 min
  6. 6 Summary - Enums Combine enum class and when to write a state machine. 5 min
18
Exceptions
6 lessons · 29 min
  1. 1 try/catch Learn to catch errors with try/catch. 5 min
  2. 2 throw Learn to throw exceptions with throw. 4 min
  3. 3 finally Learn the cleanup block with finally. 5 min
  4. 4 try expression Learn to use try as an expression in Kotlin. 5 min
  5. 5 Custom exceptions Learn to write custom exception classes in Kotlin. 5 min
  6. 6 Summary - Exceptions Combine try/catch, finally and try expression to write a bank account class. 5 min
19
Class basics
6 lessons · 30 min
  1. 1 class Learn to define classes with class. 5 min
  2. 2 Constructor Learn to define the class constructor. 5 min
  3. 3 Properties Learn to declare properties in a class. 5 min
  4. 4 Methods Learn to define methods in a class. 5 min
  5. 5 this Learn to access the class itself with this. 5 min
  6. 6 Summary - Class basics Combine class, constructor and methods to write a User class. 5 min
20
Beginner finalProject
5 lessons · 30 min
  1. 1 Project design Design the skeleton of the beginner final mini app. 6 min
  2. 2 Classes Set up the data model with class and constructor. 6 min
  3. 3 Collections Write data management with List and Map. 6 min
  4. 4 Error handling Add error handling with try/catch. 6 min
  5. 5 Putting it together Combine all parts into a working final app. 6 min

Learn OOP, inheritance, data class, sealed class, extension functions, generics and higher-order functions in Kotlin.

1
Classes in depth
6 lessons · 30 min
  1. 1 Primary constructor Learn the primary constructor and init block. 5 min
  2. 2 Secondary constructor Learn multiple constructors with secondary constructors. 5 min
  3. 3 Properties Learn mutable and read-only properties. 5 min
  4. 4 lateinit and lazy Learn deferred initialization with lateinit and by lazy. 5 min
  5. 5 companion object Learn class-level members with companion object. 5 min
  6. 6 Summary - Classes Combine primary/secondary constructors and companion object to write a Point class. 5 min
2
Inheritance
6 lessons · 30 min
  1. 1 open Learn to define inheritable classes with open. 5 min
  2. 2 override Learn to redefine methods with override. 5 min
  3. 3 super Learn to call base class methods with super. 5 min
  4. 4 abstract Learn abstract classes with abstract. 5 min
  5. 5 interface Learn to implement interfaces. 5 min
  6. 6 Summary - Inheritance Combine open, override and abstract to write a shape hierarchy. 5 min
3
Data class
6 lessons · 30 min
  1. 1 data class Learn to define data classes with data class. 5 min
  2. 2 copy Learn to copy data classes with copy. 5 min
  3. 3 equals and hashCode Learn automatic equals and hashCode generation. 5 min
  4. 4 toString Learn automatic toString generation. 5 min
  5. 5 Destructuring Learn componentN and destructuring declarations. 5 min
  6. 6 Summary - Data class Combine data class, copy and destructuring to write a User model. 5 min
4
Project: Helper libraryProject
5 lessons · 30 min
  1. 1 Module design Design the skeleton of the helper library class. 6 min
  2. 2 String helpers Add and test string processing functions. 6 min
  3. 3 Number helpers Add number conversion and calculation functions. 6 min
  4. 4 Date helpers Add LocalDate processing functions. 6 min
  5. 5 Putting it together Combine helper functions into a library. 6 min
5
Sealed class
6 lessons · 30 min
  1. 1 sealed class Learn closed hierarchies with sealed class. 5 min
  2. 2 when with sealed Learn exhaustive branching on sealed classes with when. 5 min
  3. 3 Sealed and data Learn to use data classes inside sealed classes. 5 min
  4. 4 Sealed and state Learn state management with sealed classes. 5 min
  5. 5 Sealed and result Learn a Result-like pattern with sealed classes. 5 min
  6. 6 Summary - Sealed class Combine sealed class, when and data class to write a result model. 5 min
6
Object declaration
6 lessons · 30 min
  1. 1 object Learn to define singleton classes with object. 5 min
  2. 2 companion object Learn class-level members with companion object. 5 min
  3. 3 Object expression Learn to create anonymous objects with object:. 5 min
  4. 4 companion and interface Learn to implement interfaces with companion object. 5 min
  5. 5 object vs class Learn the difference between object and class. 5 min
  6. 6 Summary - Object declaration Combine object, companion object and object expression to write a helper object. 5 min
7
Extension functions
6 lessons · 30 min
  1. 1 Extension functions Learn extension functions with fun Receiver.ext(). 5 min
  2. 2 Extension properties Learn extension properties with val Receiver.ext. 5 min
  3. 3 Nullable extensions Learn extension functions with nullable receivers. 5 min
  4. 4 companion extensions Learn to add extensions to companion objects. 5 min
  5. 5 Standard library Learn extensions in the Kotlin standard library. 5 min
  6. 6 Summary - Extension functions Combine extension functions, properties and nullable extensions to write a string helper extension. 5 min
8
Project: Quiz appProject
5 lessons · 30 min
  1. 1 Quiz model Design the Question data class and list. 6 min
  2. 2 Adding questions Learn to add questions with the addQuestion function. 6 min
  3. 3 Running the quiz Learn to ask questions in turn with the runQuiz function. 6 min
  4. 4 Score calculation Learn correct count with the score calculation function. 6 min
  5. 5 Putting it together Combine the quiz functions with a menu loop. 6 min
9
Generics
6 lessons · 30 min
  1. 1 Generic class Learn generic classes with class Box<T>. 5 min
  2. 2 Generic functions Learn generic functions with fun <T>. 5 min
  3. 3 Variance Learn in, out and variance concepts. 5 min
  4. 4 Type constraints Learn type constraints with where and upper bounds. 5 min
  5. 5 Reified Learn runtime type info with reified. 5 min
  6. 6 Summary - Generics Combine generic class, functions and variance to write a Stack<T>. 5 min
10
Higher-order functions
6 lessons · 30 min
  1. 1 Function types Learn function types with (Int) -> String. 5 min
  2. 2 Lambda Learn lambda expressions with { x -> x * 2 }. 5 min
  3. 3 it Learn single-parameter lambdas with it. 5 min
  4. 4 inline Learn performance optimization with inline. 5 min
  5. 5 Scope functions Learn let, run, apply, also and with scope functions. 5 min
  6. 6 Summary - Higher-order functions Combine lambdas, it and scope functions to write a processing pipeline. 5 min
11
Project: Library appProject
5 lessons · 30 min
  1. 1 Model design Design the skeleton of Book and Member data classes. 6 min
  2. 2 Library class Set up collection management with the Library class. 6 min
  3. 3 Checking out Write the checkout flow with checkout and return functions. 6 min
  4. 4 Search and filter Write search and filtering with collection methods. 6 min
  5. 5 Putting it together Combine the Library class with a menu loop. 6 min
12
Advanced collections
6 lessons · 30 min
  1. 1 map and filter Learn collection transformation with map and filter. 5 min
  2. 2 fold and reduce Learn aggregation with fold and reduce. 5 min
  3. 3 groupBy and partition Learn grouping with groupBy and partition. 5 min
  4. 4 sortedBy and sortedWith Learn sorting with sortedBy and sortedWith. 5 min
  5. 5 associate and flatMap Learn transformation with associate and flatMap. 5 min
  6. 6 Summary - Advanced collections Combine map, fold and groupBy to write a sales report. 5 min
13
Delegation
6 lessons · 30 min
  1. 1 by Learn class delegation with by. 5 min
  2. 2 Delegated properties Learn delegation with by lazy and by observable. 5 min
  3. 3 by map Learn dynamic properties with by map. 5 min
  4. 4 vetoable Learn vetoable properties with vetoable. 5 min
  5. 5 Custom delegates Learn to write your own property delegates. 5 min
  6. 6 Summary - Delegation Combine by, lazy and custom delegates to write a cache system. 5 min
14
Value class
6 lessons · 30 min
  1. 1 value class Learn wrappers with @JvmInline value class. 5 min
  2. 2 Type safety Learn type safety with value classes. 5 min
  3. 3 Methods Learn to define methods in value classes. 5 min
  4. 4 Generic value class Learn to use generic value classes. 5 min
  5. 5 value class vs data class Learn the difference between value class and data class. 5 min
  6. 6 Summary - Value class Combine value class, methods and type safety to write a UserId class. 5 min
15
Coroutine basics
6 lessons · 30 min
  1. 1 What are coroutines? Learn the coroutine and async programming concept. 5 min
  2. 2 launch Learn to start coroutines with GlobalScope.launch. 5 min
  3. 3 suspend Learn suspendable functions with suspend fun. 5 min
  4. 4 runBlocking Learn coroutine main with runBlocking. 5 min
  5. 5 async/await Learn parallel coroutines with async and await. 5 min
  6. 6 Summary - Coroutine basics Combine launch, suspend and async/await to write a parallel downloader. 5 min
16
Flow basics
6 lessons · 30 min
  1. 1 Flow Learn the cold stream concept with Flow. 5 min
  2. 2 flow builder Learn to create Flows with flow { }. 5 min
  3. 3 collect Learn to consume Flows with collect. 5 min
  4. 4 map and filter Learn Flow transformation with map and filter. 5 min
  5. 5 flowOn Learn context switching with flowOn. 5 min
  6. 6 Summary - Flow basics Combine flow, collect and map to write an event stream. 5 min
17
File I/O
6 lessons · 30 min
  1. 1 File Learn file operations with java.io.File. 5 min
  2. 2 readText Learn to read files with File.readText. 5 min
  3. 3 writeText Learn to write files with File.writeText. 5 min
  4. 4 readLines Learn to read lines with File.readLines. 5 min
  5. 5 appendText Learn to append to files with File.appendText. 5 min
  6. 6 Summary - File I/O Combine readText, writeText and readLines to write a notes app. 5 min
18
Packages and modules
6 lessons · 28 min
  1. 1 package Learn package declarations with package. 4 min
  2. 2 import Learn to import packages with import. 4 min
  3. 3 internal Learn module visibility with internal. 5 min
  4. 4 Gradle Learn build configuration with Gradle. 5 min
  5. 5 kotlinx Learn kotlinx libraries. 5 min
  6. 6 Summary - Packages Combine package, import and internal to set up a module structure. 5 min
19
Testing
6 lessons · 30 min
  1. 1 JUnit Learn the JUnit 5 test framework. 5 min
  2. 2 @Test Learn to write tests with the @Test annotation. 5 min
  3. 3 Assertions Learn assertions with assertEquals and assertTrue. 5 min
  4. 4 @BeforeEach Learn fixtures with @BeforeEach and @AfterEach. 5 min
  5. 5 MockK Learn mocking with MockK. 5 min
  6. 6 Summary - Testing Combine @Test, assertions and MockK to write a calculator test. 5 min
20
Intermediate finalProject
5 lessons · 30 min
  1. 1 Project design Design the skeleton of the intermediate final mini app. 6 min
  2. 2 OOP model Set up the class hierarchy and interfaces. 6 min
  3. 3 Collections Write data filtering with List, Map and Flow. 6 min
  4. 4 File I/O Save and load data with File. 6 min
  5. 5 Putting it together Combine all layers into a working app. 6 min

Learn coroutines in depth, Flow, Ktor, kotlinx.serialization, Exposed and DI in Kotlin.

1
Advanced coroutines
6 lessons · 30 min
  1. 1 CoroutineScope Learn structured concurrency with CoroutineScope. 5 min
  2. 2 Dispatchers Learn contexts with Dispatchers.IO, Default and Main. 5 min
  3. 3 Job Learn Job and Job hierarchy. 5 min
  4. 4 SupervisorJob Learn error isolation with SupervisorJob. 5 min
  5. 5 CoroutineExceptionHandler Learn error handling with CoroutineExceptionHandler. 5 min
  6. 6 Summary - Advanced coroutines Combine CoroutineScope, Dispatchers and Job to write a parallel job manager. 5 min
2
Advanced Flow
6 lessons · 30 min
  1. 1 StateFlow Learn state streams with StateFlow. 5 min
  2. 2 SharedFlow Learn shared streams with SharedFlow. 5 min
  3. 3 Channel Learn inter-coroutine communication with Channel. 5 min
  4. 4 debounce and conflate Learn stream control with debounce and conflate. 5 min
  5. 5 flatMapLatest Learn latest stream with flatMapLatest. 5 min
  6. 6 Summary - Advanced Flow Combine StateFlow, SharedFlow and Channel to write an event system. 5 min
3
Ktor HTTP client
6 lessons · 30 min
  1. 1 Ktor client Learn the HTTP client with Ktor client. 5 min
  2. 2 HttpClient Learn HttpClient configuration. 5 min
  3. 3 GET Learn GET requests with client.get. 5 min
  4. 4 POST Learn POST requests with client.post. 5 min
  5. 5 JSON deserialization Learn JSON deserialization with kotlinx.serialization. 5 min
  6. 6 Summary - Ktor HTTP Combine HttpClient, GET and JSON to write an API client. 5 min
4
Ktor server
6 lessons · 30 min
  1. 1 Ktor server Learn HTTP servers with Ktor server. 5 min
  2. 2 Routing Learn URL routes with routing. 5 min
  3. 3 Application Learn Application and module structure. 5 min
  4. 4 Plugins Learn ContentNegotiation and StatusPages plugins. 5 min
  5. 5 WebSocket Learn realtime communication with Ktor WebSocket. 5 min
  6. 6 Summary - Ktor server Combine routing, plugins and WebSocket to write an API. 5 min
5
kotlinx.serialization
6 lessons · 30 min
  1. 1 @Serializable Learn class serialization with @Serializable. 5 min
  2. 2 Json Learn Json.encodeToString and decodeFromString. 5 min
  3. 3 @SerialName Learn JSON key names with @SerialName. 5 min
  4. 4 @Optional Learn optional fields with @Optional and defaults. 5 min
  5. 5 Polymorphism Learn polymorphic serialization. 5 min
  6. 6 Summary - kotlinx.serialization Combine @Serializable, Json and @SerialName to write an API model. 5 min
6
Exposed SQL
6 lessons · 30 min
  1. 1 Exposed Learn the JetBrains Exposed ORM. 5 min
  2. 2 Table Learn to define schemas with Table object. 5 min
  3. 3 Transaction Learn SQL operations with the transaction block. 5 min
  4. 4 CRUD Learn CRUD with insert, select, update and delete. 5 min
  5. 5 Join Learn table joins with join. 5 min
  6. 6 Summary - Exposed SQL Combine Table, transaction and CRUD to write a user database. 5 min
7
Dependency injection
6 lessons · 30 min
  1. 1 Koin Learn the Koin DI framework. 5 min
  2. 2 module Learn to define modules with module { }. 5 min
  3. 3 single and factory Learn binding types with single and factory. 5 min
  4. 4 by inject Learn to inject dependencies with by inject(). 5 min
  5. 5 by viewModel Learn ViewModel injection with by viewModel(). 5 min
  6. 6 Summary - DI Combine module, single and by inject to write a service layer. 5 min
8
Advanced testing
6 lessons · 30 min
  1. 1 Testing coroutines Learn coroutine testing with runTest. 5 min
  2. 2 Turbine Learn Flow testing with Turbine. 5 min
  3. 3 Advanced MockK Learn advanced MockK with coEvery and coVerify. 5 min
  4. 4 Testcontainers Learn integration testing with Testcontainers. 5 min
  5. 5 Property tests Learn property-based testing with kotest-property. 5 min
  6. 6 Summary - Advanced testing Combine runTest, Turbine and MockK to write a ViewModel test. 5 min
9
Functional programming
6 lessons · 30 min
  1. 1 Immutability Learn immutability with val and data class. 5 min
  2. 2 Pure functions Learn pure functions and side effects. 5 min
  3. 3 Sequence Learn lazy collections with Sequence. 5 min
  4. 4 Fold and recursion Learn functional patterns with fold and recursion. 5 min
  5. 5 Monad Learn monad patterns like Result and Either. 5 min
  6. 6 Summary - Functional programming Combine immutability, Sequence and Result to write a functional pipeline. 5 min
10
Collection stdlib
6 lessons · 30 min
  1. 1 windowed Learn windowing with windowed. 5 min
  2. 2 chunked Learn chunking with chunked. 5 min
  3. 3 zip and unzip Learn combining with zip and unzip. 5 min
  4. 4 scan Learn intermediate results with scan. 5 min
  5. 5 flatMap and flatten Learn flattening with flatMap and flatten. 5 min
  6. 6 Summary - Collection stdlib Combine windowed, chunked and zip to write a data pipeline. 5 min
11
Reflection
6 lessons · 30 min
  1. 1 KClass Learn class info with ::class and KClass. 5 min
  2. 2 KProperty Learn property info with KProperty. 5 min
  3. 3 KFunction Learn method info with KFunction. 5 min
  4. 4 call Learn dynamic calls with KFunction.call. 5 min
  5. 5 Annotations Learn to read annotations with reflection. 5 min
  6. 6 Summary - Reflection Combine KClass, KProperty and call to write a serialization framework. 5 min
12
Concurrency patterns
6 lessons · 30 min
  1. 1 Mutex Learn mutual exclusion with Mutex. 5 min
  2. 2 Semaphore Learn counted access with Semaphore. 5 min
  3. 3 Producer-consumer Learn the producer-consumer pattern with Channel. 5 min
  4. 4 Rate limiter Learn the rate limiter pattern. 5 min
  5. 5 Circuit breaker Learn the circuit breaker pattern. 5 min
  6. 6 Summary - Concurrency patterns Combine Mutex, Channel and rate limiter to write a work queue. 5 min
13
Security
6 lessons · 30 min
  1. 1 Hashing Learn hashing with java.security.MessageDigest. 5 min
  2. 2 HMAC Learn message authentication with HMAC. 5 min
  3. 3 AES Learn AES encryption with javax.crypto. 5 min
  4. 4 SecureRandom Learn secure random with SecureRandom. 5 min
  5. 5 PBKDF2 Learn password hashing with PBKDF2. 5 min
  6. 6 Summary - Security Combine hash, HMAC and AES to write an encryptor. 5 min
14
Advanced finalProject
5 lessons · 30 min
  1. 1 Project design Design the skeleton of the advanced final mini app. 6 min
  2. 2 Ktor API Set up the REST API skeleton with Ktor. 6 min
  3. 3 Exposed DB Write the database layer with Exposed. 6 min
  4. 4 Coroutines Write async processing with coroutines and Flow. 6 min
  5. 5 Putting it together Combine all layers into a working mini service. 6 min

Learn compile-time safety, KSP/KAPT, compiler plugins, Kotlin/Native, Kotlin Multiplatform and Compose Multiplatform in Kotlin.

1
Compile-time safety
6 lessons · 30 min
  1. 1 Contracts Learn compile-time guarantees with Kotlin contracts. 5 min
  2. 2 Inline functions Learn performance safety with inline and noinline. 5 min
  3. 3 reified Learn runtime type safety with reified. 5 min
  4. 4 tailrec Learn recursion safety with tailrec. 5 min
  5. 5 Type-safe builders Learn type-safe builders with @DslMarker. 5 min
  6. 6 Summary - Compile-time safety Combine contracts, inline and type-safe builders to write a DSL. 5 min
2
KSP and KAPT
6 lessons · 30 min
  1. 1 KSP Learn the Kotlin Symbol Processing (KSP) concept. 5 min
  2. 2 KSP processor Learn to write a KSP processor. 5 min
  3. 3 KAPT Learn KAPT annotation processing. 5 min
  4. 4 KSP vs KAPT Learn the difference between KSP and KAPT. 5 min
  5. 5 Generated code Learn code generation with KSP. 5 min
  6. 6 Summary - KSP and KAPT Combine KSP processor, KAPT and code generation to write an annotation processor. 5 min
3
Compiler plugin
6 lessons · 30 min
  1. 1 Compiler plugins Learn the Kotlin compiler plugin concept. 5 min
  2. 2 IR Learn Kotlin IR (Intermediate Representation). 5 min
  3. 3 Plugin vs KSP Learn the difference between compiler plugins and KSP. 5 min
  4. 4 all-open Learn the all-open compiler plugin. 5 min
  5. 5 no-arg Learn the no-arg compiler plugin. 5 min
  6. 6 Summary - Compiler plugins Combine IR, all-open and no-arg to write a framework integration. 5 min
4
Kotlin/Native
6 lessons · 30 min
  1. 1 Kotlin/Native Learn native compilation with Kotlin/Native. 5 min
  2. 2 Interop Learn C libraries with C interop. 5 min
  3. 3 Memory model Learn the Kotlin/Native memory model. 5 min
  4. 4 Konan Learn the Konan compiler. 5 min
  5. 5 Native library Learn to write native libraries with Kotlin/Native. 5 min
  6. 6 Summary - Kotlin/Native Combine interop, memory model and native library to write a native module. 5 min
5
Kotlin Multiplatform
6 lessons · 30 min
  1. 1 KMP Learn the Kotlin Multiplatform (KMP) concept. 5 min
  2. 2 commonMain Learn shared code with commonMain. 5 min
  3. 3 expect/actual Learn platform code with expect/actual. 5 min
  4. 4 iOS target Learn the iOS target with KMP. 5 min
  5. 5 JS target Learn the JavaScript target with KMP. 5 min
  6. 6 Summary - KMP Combine commonMain, expect/actual and platform targets to write a KMP library. 5 min
6
Compose Multiplatform
6 lessons · 30 min
  1. 1 Compose MP Learn the Compose Multiplatform concept. 5 min
  2. 2 @Composable Learn to write components with @Composable. 5 min
  3. 3 remember Learn state retention with remember. 5 min
  4. 4 MutableState Learn reactive state with mutableStateOf. 5 min
  5. 5 Platform UI Learn platform UI with Compose (Desktop, Web). 5 min
  6. 6 Summary - Compose MP Combine @Composable, remember and MutableState to write a cross-platform UI. 5 min
7
Performance
6 lessons · 30 min
  1. 1 Profiling Learn performance measurement with JVM profiling and JMH. 5 min
  2. 2 Allocation Learn object allocation and GC impact. 5 min
  3. 3 inline Learn function call optimization with inline. 5 min
  4. 4 Sequence Learn lazy computation optimization with Sequence. 5 min
  5. 5 Coroutine overhead Learn coroutine and thread cost. 5 min
  6. 6 Summary - Performance Combine profiling, inline and Sequence to write an optimized copy function. 5 min
8
Expert finalProject
5 lessons · 30 min
  1. 1 Project design Design the skeleton of the expert final mini app. 6 min
  2. 2 KMP Write a shared module with Kotlin Multiplatform. 6 min
  3. 3 KSP Write code generation with KSP. 6 min
  4. 4 Compose Write UI with Compose Multiplatform. 6 min
  5. 5 Putting it together Combine all expert topics into a working mini app. 6 min

Lessons are free, an account keeps your progress

You do not have to sign up. If you do, you continue where you left off and never lose your work.

  • Progress saved on every device
  • Earn XP and badges
  • Keep your daily streak
  • Get a certificate when you finish
create a free account

Frequently asked questions

Are the Kotlin lessons free?

Yes. All 362 lessons of the Kotlin course are free and you can start without an account.

Do I need any prior knowledge?

No. The beginner level starts from zero; a browser is all you need. If you already know the basics, start at a higher level.

How long does the course take?

Lessons take 2–8 minutes. The whole course is about 30 hours; with 15–20 minutes a day you can finish in a few months.

Do I get a certificate?

Yes. When you complete the course with a free account, a verifiable certificate is issued in your name.

Will I lose my progress without an account?

Without an account your progress is kept only in your current browser. When you create a free account it is moved to your account.

Next step SQL

Learn all levels of SQL from SELECT, JOIN and subqueries to indexing and performance tuning.