Preparation for Kotlin Interview Test

Why a developer can prefer Kotlin over Java?


Because Kotlin has several features which even modern versions of Java lack.

Let’s list down few of them.

  • Kotlin support best features of functional programming and OO programming language.
  • Kotlin handles Null Pointer Exceptions easily.
  • Kotlin support lambdas, higher order functions, smart casting.
  • Approximately 40 % less number of code lines as compared to Java.


Kotlin comparison to Java

Can kotlin code be executed without JVM?

Answer :-

Yes this is feature of Kotlin / Native which is under development. It compile Kotlin code into native code which can be executed without JVM.

What ara Data classes in Kotlin and how they can be compared with POJO?


Creating Data Classes in Kotlin (DTO / POJO) example

What is Kotlin String Interpolation ?


String Templates in Kotlin can be evaluated (interpolated).


String Interpolation and String Templates in Kotlin example

How do you define Singleton Object in Kotlin ?

We can use companion object in Kotlin to declare a class Singleton.

Kotlin companion object also solve problem of static member and static functions, because any property inside companion object can be called without creating instance of class.


class AppClass : Application() {
    companion object {
        var instance: AppClass
    override fun onCreate() {
        instance = this

How Kotlin handle Null Pointer Exceptions ?


What are three structural expressions in Kotlin ?


What are different Types of Constructors in Kotlin, explain them.


There are two different types of constructors in Kotlin.

  • Primary constructor
  • Secondary constructor

Primary constructor is part of class header and is declared after class name.

Secondary constructor is declared inside class body.

Class can have one or more Secondary constructor.

What is equivalent of Switch Statement in Java in Kotlin ?


In Kotlin when is alternate of Switch statement.


when (x) { is Foo -> ...  (true if x is of type Foo)
 is Bar -> ...  (true if x is of type Bar)
 else -> ...    (true if none of the above condition is met)


Instance checks or Type checking in Kotlin example

Can when statement in Kotlin be used without passing any argument ?


Yes, in that case each branch of when statement will work as if else if.

If any branch fulfills its condition its body will be executed.

Does Kotlin support Checked Exceptions like in Java ?  if yes give an example.


No, Kotlin does not support Checked Exceptions.

What is Elvis Expression in Kotlin ?

What is Kotlin/Native Multiplatform project?



Kotlin Native iOS Development using Multiplatform Project

What are primitive Data Types in kotlin ?


Kotlin does not support primitive Data Types like in Java.

What are open, final and abstract Modifiers in Kotlin ?


Open, final and abstract modifiers in Kotlin

Can we pass different number of arguments to same Function in Kotlin ?



What are inline functions in Kotlin ?


How to declare mutable and immutable Objects in Kotlin ?


We use var and val keywords to declare any property mutable or immutable in Kotlin.

The post Top Kotlin Interview Questions and Answers appeared first on Welcome to Developine.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 401 other subscribers