All quizzes
Free quiz · 50 questions in the bank

Kotlin quiz

Test your Kotlin knowledge with a free interactive quiz — 50 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What does `object MyService { … }` declare?

Questions in this quiz
  1. What does `object MyService { … }` declare?
  2. What is a `companion object`?
  3. Why must Kotlin classes be marked `open` to allow inheritance?
  4. Inside an `apply { … }` block, what does `this` refer to and what does the block return?
  5. What is the difference between `==` and `===` in Kotlin?
  6. What does this return: `listOf(1, 2, 3).map { it * 2 }`?
  7. What is the `!!` operator?
  8. How are default parameter values declared?
  9. Which auto-generated members does `data class` provide?
  10. What is the result type of `if/else` used as an expression?
  11. What is an `init` block?
  12. How does Kotlin's `when` differ from Java's `switch`?
Gaps to close?
Read the curated Kotlin notes — core concepts, patterns, interview prep.
Kotlin notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web