Kotlin

Kotlin

Test your Kotlin knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is Kotlin primarily used for?

    • Web Development
    • Android Development
    • Game Development
    • Embedded Systems
  2. Which keyword is used to declare a read-only variable in Kotlin?

    • var
    • val
    • let
    • const
  3. Which IDE is officially recommended for Kotlin development?

    • Eclipse
    • IntelliJ IDEA
    • NetBeans
    • Visual Studio
  4. Which symbol is used to indicate a nullable type in Kotlin?

    • !
    • ?
    • *
    • &
  5. Which statement is used as a replacement for switch in Kotlin?

    • case
    • when
    • choose
    • select
  6. Which Kotlin collection function transforms each element?

    • map
    • filter
    • reduce
    • fold
  7. Which keyword makes a class inheritable?

    • extend
    • open
    • public
    • super
  8. Which function removes null values from a collection?

    • filterNulls()
    • removeNull()
    • filterNotNull()
    • compact()
  9. What is the purpose of data classes in Kotlin?

    • Hold state only
    • Hold data and provide equals/hashCode/toString automatically
    • Create immutable classes
    • Provide UI components
  10. Which keyword is used to override a method?

    • over
    • override
    • extends
    • open
  11. Which keyword is used to declare a coroutine function?

    • async
    • suspend
    • launch
    • defer
  12. Which coroutine builder returns a result?

    • launch
    • async
    • runBlocking
    • withContext
  13. Which Kotlin feature allows creating mini-languages?

    • DSL
    • KTX
    • Coroutines
    • Reflection
  14. Which function is used to change coroutine context?

    • switchContext
    • withContext
    • changeDispatcher
    • contextSwitch
  15. Which operator is used for type-safe builders in Kotlin?

    • invoke
    • builder
    • lambda
    • receiver