Kotlin Typing Practice

Master Kotlin syntax with real-world code examples. Practice typing Kotlin code to boost your development speed and reduce syntax errors.

Start Kotlin Practice

Why Practice Kotlin Typing?

Null Safety

Master the ? and !! operators, plus the Elvis operator ?:.

Lambdas and Higher-Order Functions

Practice { } lambda syntax and the it keyword.

Data Classes and Sealed Classes

Get familiar with data class and sealed class declarations.

Extension Functions

Smoothly type syntax for adding functions to existing classes.

Common Kotlin Syntax

Practice these common Kotlin syntax patterns for smooth coding:

  • val name: String?
  • data class User(val id: Int)
  • list.filter { it > 0 }
  • fun String.extend()

Why practice typing Kotlin code?

Kotlin is concise, and that concision is built out of symbols. A single line can hold a type annotation after a colon, a nullable question mark, a safe call ?., an Elvis operator ?:, a lambda with an arrow and a ${} string template. With fewer characters per line, each character carries more meaning, and a slip on one of them changes what the code does or stops it from compiling.

That makes Kotlin a good fit for focused typing practice. Most of its operators involve Shift: on a US keyboard ?, :, $, {, } and > all need it, and on JIS several of them do as well. Once these combinations are automatic, you can write a chain like user?.address?.city ?: "Unknown" in one go instead of hunting for each key, and keep your attention on the code you are designing.

In DevType you type real Kotlin snippets, from short declarations at level 1 to longer functions and classes at level 5. Leading indentation is entered automatically and is not counted, so the practice concentrates on keywords such as fun, val and data class and on the symbols between them.

Symbols you type often in Kotlin

val / var

Read-only and mutable declarations

Idiomatic Kotlin leans heavily on val. The two words differ only in the last letter, l for the right ring finger and r for the left index finger, so habit can make you type the wrong one. Glance at the declaration before you type it rather than relying on muscle memory.

: Type

Type annotations

Types follow a colon, as in val count: Int or fun name(): String. On US the colon is Shift + semicolon; on JIS it has its own key to the right of the semicolon and needs no Shift. Kotlin style puts no space before the colon and one space after it.

String?

Nullable types

A question mark directly after a type makes it nullable. ? is Shift + slash on both US and JIS. It is easy to drop at the end of a type, which quietly turns a nullable parameter into a non-null one and makes the compiler complain somewhere else.

?.

Safe call

Type the question mark and the period in quick succession: Shift + slash, then release Shift for the period. The two keys sit next to each other under the right hand, so with practice the pair becomes a single roll of the fingers.

?:

Elvis operator

Supplies a default when the left side is null. On US both characters are Shift chords (Shift + slash, then Shift + semicolon), so you can keep Shift held. On JIS the colon needs no Shift, so release Shift right after the question mark.

!!

Not-null assertion

Two exclamation marks, Shift + 1 twice on both layouts, a reach for the left hand far from the home row. Because !! throws when the value is null, idiomatic code uses it less than ?. and ?:, but you will still meet it, especially in tests.

{ x -> }

Lambdas

Inside the braces, parameters come first, then an arrow, then the body. - is its own key on both layouts and > is Shift + period. Braces are Shift + [ and Shift + ] on US; on JIS the bracket keys sit to the right of @ and :, and the braces are Shift + those keys.

it

Implicit lambda parameter

A lambda with a single parameter can refer to it as it, as in list.filter { it > 0 }. It is only two letters, but typing x -> out of habit and then switching to it halfway is a common stumble. Check whether the snippet names the parameter before you start.

::

Callable references

Used in String::length, ::println or this::onClick. On US this is Shift + semicolon twice; on JIS you press the colon key twice without Shift. Keep the reference attached to both sides with no spaces.

${ }

String templates

$name inserts a variable and ${expr} inserts an expression. $ is Shift + 4 on both layouts. For property access such as ${user.name}, the braces are required; without them Kotlin inserts user and then the literal text .name.

Kotlin typing data on DevType

Median speed
18 WPM
Top 10% speed
45 WPM
Average accuracy
93.2%

Most mistyped symbols

  1. 1.=
  2. 2.:
  3. 3.(
  4. 4.)
  5. 5."

Based on Kotlin plays on DevType as of November 2026. Plays shorter than 5 seconds are excluded. The numbers are updated as more records come in.

Common typing mistakes in Kotlin

Leaving out the braces in a string template

$user.name inserts the whole user object followed by the text .name. Whenever the template contains a dot, a call or an operator, wrap it in ${}. The code still compiles, so the mistake only shows up in the output.

println("Hello, ${user.name}!")
println("Count: $count")

Mixing up ?. and ?:

Both start with a question mark, so at speed it is easy to type the wrong second character. ?. continues a chain, while ?: ends it with a default value. Read which one the line uses before your right hand commits.

val city = user?.address?.city ?: "Unknown"

Writing types Java-style

Developers coming from Java sometimes type the type before the name. In Kotlin the name comes first, followed by a colon and the type, and the return type goes after the parameter list.

fun greet(name: String, times: Int = 1): String {
    return "Hi, $name".repeat(times)
}

Putting = and -> in the wrong place

Single-expression functions use =, while lambdas use ->. Typing => out of habit from other languages is another typical slip. Kotlin uses -> both in lambdas and in when branches.

fun square(x: Int) = x * x
val double = { x: Int -> x * 2 }

Losing track of braces in lambda chains

Chains of filter, map and let stack braces quickly, and trailing lambdas mean a call can end in a brace instead of a parenthesis. It is easy to close the inner lambda and forget the outer one. Close each lambda before you move to the next line.

val names = users
    .filter { it.isActive }
    .map { it.name.uppercase() }

Tips to type Kotlin faster

Practice the null-safety operators as patterns

?., ?: and !! appear in a few fixed shapes. Rather than thinking of them as separate keys, practice whole fragments such as ?.let {, ?: return and ?: "" until each comes out as one motion.

Press Shift with the opposite hand

On US, ?, :, $, {, } and > are all Shift chords, and Kotlin lines often contain several in a row. Pressing Shift with the hand that is not typing the key keeps the other hand near the home row and reduces errors in dense lines.

Match the physical layout and use the keyboard guide

Set the physical layout (ANSI, ISO or JIS) in Settings so the keyboard guide and key accuracy analysis show your real key positions. If you still look down for $, : or the braces, turn the guide on; it highlights the next key and the finger to use.

Read the shape of the line first

Kotlin lines often start with a declaration and end in a lambda. A quick look before typing tells you whether there is a type annotation, a nullable mark or a trailing lambda to close, which saves most backtracking.

Turn weak spots into practice problems

Use Tab+Enter to retry a snippet that tripped you up and Esc for a fresh one. After a session, check the AI typing analysis for weak keys and fingers, then use AI problem generation or a custom problem to drill the patterns that slowed you down.

Kotlin typing practice plan

  1. 1

    Level 1: clean declarations

    Start with short snippets of val, var and type annotations and aim for runs with almost no mistakes, ignoring speed. Pay attention to the colon and the question mark after types. If a run gets messy, press Tab+Enter and repeat it until it is clean.

  2. 2

    Levels 2-3: null safety and lambdas

    Move on to control structures and method chains with ?., ?:, lambdas and it. Keep accuracy as the first goal and let your WPM rise on its own. Notice where you hesitate, often at -> or at the closing brace of a lambda, and slow down there on purpose.

  3. 3

    Level 4: add the pace caret

    Once accuracy is stable, turn on the pace caret in Settings → Play Screen and set a target slightly above your current WPM. Try to keep up with it without letting mistakes increase, and raise the target only after you can follow it comfortably.

  4. 4

    Level 5: full features and review

    Practice the longest snippets, which look like real functions and classes. After each session, read the AI typing analysis and watch the replay to see where you paused, then target those spots with custom or AI-generated problems.

Kotlin code examples

Each example has a line-by-line explanation and can be practiced right away (practice results are not recorded in the rankings).

Kotlin typing practice FAQ

Does typing practice help when the IDE completes Kotlin code for me?

Completion is excellent for names and imports, but most of the symbols that make up Kotlin syntax, such as ?., ?:, ->, braces and string templates, are still typed by hand. Typing them fluently keeps you in the flow while the IDE handles the long identifiers, and it helps in places where completion is limited, like code reviews, coding interviews or quick edits in a browser.

Is Kotlin typing practice useful for Android developers?

Yes. Android code written in Kotlin uses the same syntax you practice here: null-safe calls, lambdas for listeners and collection operations, data classes and string templates. Being fluent with these patterns carries over directly to everyday app code.

Which Kotlin symbols need attention on a JIS keyboard?

On JIS the colon has its own key, so type annotations and :: are comfortable. $ and ? need Shift as on US, the double quote is Shift + 2 rather than next to Enter, and the braces are Shift with the keys to the right of @ and :. Set the physical layout to JIS in DevType so the keyboard guide and analysis match your keys.

How does DevType measure my Kotlin typing speed?

WPM is the number of valid keystrokes divided by five, per minute. Leading indentation is entered automatically and is not counted, while Enter counts as one keystroke. Your score also reflects accuracy, difficulty level and combo, so clean runs matter as much as speed.