Kotlin Typing Speed Test
Kotlin's null-safety operators — `?.`, `?:`, `!!` — put the question mark in positions no other mainstream language uses. Combined with trailing lambdas and string templates, Kotlin has a compact but distinctive symbol set worth drilling deliberately.
Question Marks in Working Positions
Safe-call chains like `user?.address?.city` interleave question marks with periods repeatedly, and the Elvis operator `?:` fuses question mark and colon into Kotlin's signature two-symbol chunk. String templates use `$name` for simple variables and `${expr}` for expressions, putting the dollar sign inside quotes — the reverse of PHP's placement, and a genuine retraining problem for polyglots.
Trailing lambda syntax moves braces outside parentheses (`user?.let { ... }`), `it` replaces explicit parameters, and the `to` infix builds pairs in `mapOf("id" to it.id)`. Data classes, named arguments (`wpm = 72`), and destructuring declarations (`val (speed, acc) = result`) round out patterns that reward chunk-level practice over key-level practice.
Key Drills for Kotlin:
- Elvis as one chunk: `?:` is Kotlin's most idiomatic operator. Question-mark-colon should be a single strike pair.
- Safe-call chains: Drill `?.` repeated across a chain — real Kotlin nests them three and four deep.
- Braces after parens: Trailing lambdas close `}` after the call. Practice `{ it.name }` as a complete unit.
Sample Drill: Null Safety & Elvis
Safe calls, the Elvis operator, and let scoping.
val city = user?.address?.city ?: "unknown"
user?.let {
println("Signed in as ${it.name}")
analytics.track("login", mapOf("id" to it.id))
}
All 15 Kotlin Drills
Every session picks a random drill from this pool. Use the difficulty filter above to stay on easy warm-ups or jump straight to the hard ones.
-
Null Safety & Elvis easy
Safe calls, the Elvis operator, and let scoping.
-
When with Ranges easy
Map a temperature to a label using a subject-less when expression.
-
String Templates easy
Embed variables and expressions directly inside Kotlin strings.
-
Extension Functions easy
Add an email check to String with an expression-bodied extension.
-
Map Filtering easy
Build a map with to pairs, filter by value, and average the scores.
-
Data Classes & Copy medium
Immutable data classes with copy and destructuring.
-
Sealed UI State medium
Model screen states with a sealed interface and exhaustive when.
-
Scope Functions medium
Configure objects with apply and run side effects with also.
-
Sequences over File Lines medium
Lazily scan a log with useLines and stop after ten errors.
-
Reified Type Parameters medium
Use inline reified generics to avoid passing Class objects around.
-
Coroutines & Async hard
Structured concurrency with coroutineScope and async.
-
StateFlow Search Pipeline hard
Debounce a query flow and expose results as StateFlow in a ViewModel.
-
Suspending Retry Helper hard
Retry a suspending block on IOException with doubling delays.
-
Type-safe Builder DSL hard
Build HTML with lambdas that have a receiver type.
-
Spring Boot Controller hard
Write concise Spring endpoints with expression bodies and validation.
The Symbols That Slow You Down
The keystrokes below are where Kotlin typing speed is won or lost. Key positions shown for QWERTY — the pattern transfers to any layout, just on different physical keys.
| Symbol | Used For | Keys | How to Drill It |
|---|---|---|---|
| ?. | Safe call | ? as Shift+Slash, then . unshifted | `user?.address?.city` — safe-call chains nest three and four deep. The shift-release rhythm must be automatic. |
| ?: | Elvis operator | ? as Shift+Slash, then : as Shift+Semicolon | Kotlin's signature two-symbol chunk: `val x = y ?: default`. One gesture, not two decisions. |
| !! | Not-null assertion | Shift+1 twice | Two Shift-1 strikes in sequence. Rare by design — which is exactly why it hesitates. |
| -> | Lambda arrow | - unshifted, then > as Shift+Period | In `when` branches and explicit lambdas: `{ x -> x * 2 }`. |
| $name | String template | $ as Shift+4, then identifier | The dollar sits inside quotes — the reverse of PHP's placement. Genuine retraining for polyglots. |
| (a, b) | Destructuring | Shift+9, comma, Shift+0 | `val (speed, acc) = result` — parens on the left of an assignment feel odd until drilled. |
Common Kotlin Typing Mistakes
- ✗ Mixing up `?.` and `?:` mid-chain — they're one keystroke apart and both start with Shift-slash.
- ✗ Forgetting the `$` inside string templates and typing plain braces instead.
- ✗ Hesitating on `!!` — doubled exclamation marks should be two even strikes.
What's a Good Kotlin Typing Speed?
Kotlin types compactly but symbol-densely: 30–45 WPM is solid working speed, with 50+ WPM at 96%+ accuracy being excellent. Null-safe chains are the drill that pays off most in real Kotlin.