← codetypingtest

Kotlin typing test

Kotlin is concise for a JVM language: hardly any semicolons, fun instead of long method signatures, and when instead of switch. What you type instead are type annotations after colons, ? for types that can be null, and -> in when branches.

Start the Kotlin typing test

What you'll type in Kotlin

Example: FizzBuzz in Kotlin

Kotlin's FizzBuzz passes a whole when expression to println, so the closing bracket ends up on a line of its own.

fun main() {
    for (i in 1..15) {
        println(
            when {
                i % 15 == 0 -> "FizzBuzz"
                i % 3 == 0 -> "Fizz"
                i % 5 == 0 -> "Buzz"
                else -> i
            }
        )
    }
}

Type this program now

Tips for typing Kotlin faster

All 20 Kotlin programs

Every program is real, working Kotlin. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages