KOTLIN 2.0 · 15 QUESTIONS · ABOUT 10 MINUTES

Concise on the surface. Precise underneath.

Kotlin removes Java's boilerplate, but its nulls, scope functions and equality rules reward close reading. Fifteen snippets, each explained, with your result broken down by topic. No sign-up, nothing saved.

Start the Kotlin test
val name: String? = nullprintln(name?.length ?: -1)
output-1
QUESTION 1 / 15 · NULL SAFETYEasy

What does this print?

val name: String? = nullprintln(name?.length ?: -1)

What this Kotlin test measures, in short

This test checks whether you can predict what real Kotlin does: how nullable types and ?: behave, what data classes generate, how == differs from ===, what each scope function returns, and how when, sealed classes and coroutines work.

Snippets assume Kotlin 2.0 on the JVM inside fun main. The questions are our own and not standardised against a population, so treat the result as a knowledge check, not a certification.

By What's Your IQ · Reviewed 4 Oct 2026
Format
15 predict-the-output questions, 4 options each
Topics
Null safety, classes and equality, collections and lambdas, scope functions, control flow and coroutines
Version
Kotlin 2.0, JVM
Language
Created by JetBrains; 1.0 in 2016
QUESTIONS 10 TO 12, DECODED

Five scope functions, two questions

let, run, with, apply and also all run a block on an object. They differ on just two things: do you refer to the object as it or this, and does the call return the object or the block's result?

val len = name?.let { println("Hi $it") it.length}
result =Int? (e.g. 3)
OBJECT ISit
RETURNSLambda result
REACH FOR IT WHENYou want to run code only if a value isn't null (?.let), or transform a value and keep the result.
returns objectreturns resultitalsoletthisapplyrun, with
JAVA HABITS → KOTLIN

Works, but still thinking in Java

JAVA-STYLE
fun city(u: User?): String { if (u != null) { val a = u.address if (a != null && a.city != null) { return a.city } } return "unknown"}
IDIOMATIC
fun city(u: User?) = u?.address?.city ?: "unknown"

Safe calls and Elvis collapse nested null checks into one expression, and the compiler proves nothing can be null at the end.

Kotlin-firstGoogle's stance on Android since 2019New Android libraries and documentation are designed for Kotlin first, and Jetpack Compose is Kotlin-only.2
2011 → 2016Built by an IDE company. JetBrains unveiled Kotlin in 2011 as a more concise, null-safe language fully interoperable with Java; 1.0 shipped in 2016.1
2017 · 2019Android adopts it. Google announced official support at I/O 2017 and declared Android "Kotlin-first" two years later.2
2018 · 1.3Coroutines go stable. Lightweight concurrency through suspend functions, without callbacks or extra threads.1
2024 · 2.0The K2 compiler. A rewritten compiler front end with much faster builds and smarter type inference.3
  1. JetBrains. Kotlin language documentation and release history. kotlinlang.org.
  2. Android Developers. Android's Kotlin-first approach.
  3. JetBrains. (2024). Celebrating Kotlin 2.0: Fast, smart, and multiplatform. Kotlin Blog.

Where to go next

You know Kotlin. How do you reason?

Our full IQ test measures the logic and working memory behind good code: 60 questions across four domains, about 30 minutes.

Take the full IQ test