Kotlin Code Typing Test

Live CPM0
Accuracy100%
Time01:00
Start typingKotlin / 60s
Type the displayed code. Pasting and drag-and-drop are disabled.Ready for Kotlin, 60 seconds. Start typing when you are ready.
data class CartLine(val sku: String, val priceCents: Long, val quantity: Int) class ShoppingCart { private val lines = linkedMapOf<String, CartLine>() fun add(sku: String, priceCents: Long, quantity: Int = 1): Boolean { val key = sku.trim() if (key.isEmpty() || priceCents < 0 || quantity < 1) return false val existing = lines[key] lines[key] = CartLine(key, priceCents, quantity + (existing?.quantity ?: 0)) return true } fun remove(sku: String) { lines.remove(sku.trim()) } fun totalCents(): Long = lines.values.sumOf { it.priceCents * it.quantity } fun checkout(): List<CartLine> = lines.values.toList().also { lines.clear() } } data class CartPreview(val lineCount: Int, val itemCount: Int, val subtotalCents: Long, val taxCents: Long) fun previewCart(lines: List<CartLine>, taxRateBasisPoints: Int): CartPreview { val valid = lines.filter { it.sku.isNotBlank() && it.priceCents >= 0 && it.quantity > 0 } val subtotal = valid.sumOf { it.priceCents * it.quantity } val rate = taxRateBasisPoints.coerceIn(0, 10_000) val tax = (subtotal * rate + 5_000) / 10_000 return CartPreview(valid.size, valid.sumOf { it.quantity }, subtotal, tax) } data class CartDiscount(val beforeCents: Long, val discountCents: Long, val afterCents: Long) fun calculateCartDiscount(subtotalCents: Long, percentOff: Int): CartDiscount { val subtotal = subtotalCents.coerceAtLeast(0) val discount = subtotal * percentOff.coerceIn(0, 100) / 100 return CartDiscount(subtotal, discount, subtotal - discount) } fun cartQuantitiesBySku(lines: List<CartLine>): Map<String, Int> = lines.filter { it.sku.isNotBlank() && it.quantity > 0 }.groupingBy { it.sku }.fold(0) { total, line -> total + line.quantity } fun cartSubtotalBySku(lines: List<CartLine>): Map<String, Long> = lines.filter { it.sku.isNotBlank() && it.quantity > 0 }.groupingBy { it.sku }.fold(0L) { total, line -> total + line.priceCents * line.quantity }
Focus here and start typing to begin
built for developersReal code typing practice. Useful metrics. Improve faster.Learn more

Codestroke is a code typing test for developers. Practice real JavaScript, Python, SQL, Java, C++, HTML/CSS, PHP, Go, and Kotlin snippets instead of ordinary prose.

This Kotlin typing test focuses on data classes, collection operations, lambdas, and null-safe syntax. Choose a 30, 60, or 120 second session and track your code typing speed and accuracy as you practice.

01

Real snippets

Practice syntax, punctuation, and indentation developers actually use.

02

Useful metrics

Track live CPM, accuracy, time, and detailed session results.

03

Flexible practice

Choose a 30, 60, or 120 second test and improve at your pace.

how speed and accuracy work

Code typing speed is measured in CPM (characters per minute), so symbols, brackets, and indentation count just like letters. Accuracy shows how much of the snippet you entered correctly. Pick a language to practice a focused code typing test:

code typing test FAQ

What does the Kotlin typing test include?

The Kotlin test includes realistic snippets with data classes, collection operations, lambdas, null-safe syntax, and concise typed functions.

What is a code typing test?

A code typing test measures how quickly and accurately you can type real source code instead of ordinary prose. Codestroke is built for developers.

How does a coding speed test work?

Code contains symbols, brackets, and short tokens, so CPM measures every typed character. Codestroke also reports WPM, accuracy, and the selected test duration.

Why measure CPM instead of WPM?

Words per minute can be misleading for code because syntax contains punctuation and short tokens. CPM gives a clearer view of code typing speed.

Which languages can I practice?

You can practice JavaScript, Python, SQL, Java, C++, HTML/CSS, PHP, Go, and Kotlin snippets.

Is Codestroke free?

Yes. The typing test is free in modern web browsers, and you can begin as a guest without creating an account.

Kotlin typing practice for data classes and collections

Practice Kotlin with data classes, collections, lambdas, and small stateful utilities. This route is a focused way to make Kotlin's concise expressions, generic types, and null-safe operators comfortable under time pressure.

01data classes and immutable properties

02collection operations and lambdas

03null-safe calls, sealed results, and collection transforms

Pay attention to question marks, Elvis operators, type parameters, and trailing lambdas as expressions get shorter. Compare code typing scores on the leaderboard.

language directory9 Language Speed Tests & Technical ExplainerExplore
CPM vs WPM in CodeCode snippets contain symbols, brackets, and short tokens. CPM (Characters Per Minute) measures every keypress accurately, while WPM equals CPM divided by 5.
Real Snippets & DurationsPractice 30s, 60s, or 120s sessions with real language syntax across 9 programming languages in guest mode or with optional account sync.