Skip to content

Kotlin Programming Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 170 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What is null safety in Kotlin?

Show ▼

Null safety is a Kotlin feature that eliminates NullPointerException at compile time.
By default, variables cannot hold null. You must explicitly declare a type as nullable using ?, e.g. var name: String? = null.

How do you declare a nullable type in Kotlin?

Show ▼

Append a ? to the type declaration:
var name: String? = null
Without the ?, the compiler will reject any attempt to assign null.

What is the safe call operator in Kotlin?

Show ▼

The safe call operator ?. allows you to access a property or call a method on a nullable object without risking a NullPointerException:
val length = name?.length
If name is null, the expression returns null instead of throwing.

What is the Elvis operator in Kotlin?

Show ▼

The Elvis operator ?: provides a default value when an expression is null:
val len = name?.length ?: 0
If the left side is null, the right side is used.

What does the non-null assertion operator (!!) do?

Show ▼

The !! operator converts a nullable type to a non-null type and throws a KotlinNullPointerException if the value is null:
val len = name!!.length
Use it only when you are absolutely certain the value is not null.

🎯 Take the Kotlin Programming Practice Exam