Updated:
These are questions that come up again and again in Kotlin and Android interviews, from fresher to mid level. Each answer is short enough to say out loud, and links to the course lesson if you want to revise the topic properly.
Basics
1. What is the difference between val and var?
val is read-only: once assigned, it can’t be reassigned. var can be reassigned. Prefer val by default. Note that a val holding a MutableList can still have its contents changed. (Variables lesson)
2. What is the difference between const val and val?
const val is a compile-time constant: it must be a primitive or String, declared at the top level or in an object/companion object, and is inlined. A val can hold any value computed at runtime.
3. How does Kotlin handle null safety?
Types are non-null by default. String? allows null, and the compiler forces you to handle it with ?., ?:, !!, an if check or let. (Null safety lesson)
fun main() {
val name: String? = null
println(name?.length ?: 0)
}Output:
0
4. What is the Elvis operator?
?: returns the left side if it isn’t null, otherwise the right side: val n = input ?: "Guest". The right side can also be return or throw.
5. What is the difference between == and ===?
== compares values (it calls equals). === checks whether two references point to the same object.
data class P(val x: Int)
fun main() {
val a = P(1); val b = P(1)
println(a == b)
println(a === b)
}Output:
true false
6. Does Kotlin have a ternary operator?
No. if is an expression, so you write val max = if (a > b) a else b.
7. What is a string template?
Putting values in a string with $name or ${expression}, like "Total: ${price * qty}".
Functions
8. What are default and named arguments?
Parameters can have default values (fun greet(name: String = "Guest")), and callers can pass arguments by name (greet(name = "Asha")). Together they replace most overloads.
9. What is an extension function?
A function added to an existing type from outside: fun String.isEmail() = contains("@"), called as "a@b.com".isEmail(). It can’t access private members. (Extension functions lesson)
10. What is a higher-order function?
A function that takes another function as a parameter or returns one, like filter, map or fun repeatTimes(n: Int, action: () -> Unit).
11. What is the difference between let, run, with, apply and also?
| Object as | Returns | |
|---|---|---|
let | it | lambda result |
run | this | lambda result |
with | this | lambda result |
apply | this | the object |
also | it | the object |
Typical uses: ?.let for null checks, apply to configure an object, also for logging. (Scope functions lesson)
12. What is the difference between Unit and Nothing?
A function returning Unit finishes normally with no useful value (like Java’s void). A function returning Nothing never returns: it always throws or loops forever.
13. What is an inline function?
The compiler copies the function’s body (and its lambda arguments) into the call site, which avoids creating objects for lambdas. It also allows reified type parameters and non-local return. Collection functions like map and filter are inline.
Classes and OOP
14. Why are Kotlin classes final by default?
So that classes are only extended when they were designed for it. Mark a class and its members open to allow inheritance. (Inheritance lesson)
15. What does a data class generate?
equals(), hashCode(), toString(), copy() and componentN() functions for the properties in the primary constructor. (Data classes lesson)
data class User(val name: String, val age: Int)
fun main() {
val u = User("Ravi", 28)
val (name, age) = u.copy(age = 29)
println("$u -> $name, $age")
}Output:
User(name=Ravi, age=28) -> Ravi, 29
16. What is a sealed class, and how is it different from an enum?
A sealed class has a fixed set of subclasses known at compile time, and each subclass can hold different data, which makes when exhaustive. An enum has a fixed set of single instances with the same properties. Use sealed types for states and results (Loading, Success(data), Error(msg)). (Sealed classes lesson)
17. What is the difference between an abstract class and an interface?
An abstract class can have a constructor and store state, and a class can extend only one. An interface can’t store state, but a class can implement many. Both can have abstract members and members with code.
18. What is a companion object?
An object inside a class whose members are accessed through the class name, like User.create(). It replaces Java’s static members and is often used for factory functions and constants.
19. How do you create a singleton in Kotlin?
With an object declaration: object AppConfig { … }. It’s created lazily and thread-safely the first time it’s used.
20. What is the difference between lateinit and lazy?
lateinit var is a non-null mutable property you assign later yourself (not allowed for primitives). val x by lazy { … } is computed on first access and can’t change. (Delegation lesson)
21. What are the visibility modifiers in Kotlin?
public (the default), private (class or file), protected (class and subclasses) and internal (same module).
Collections
22. What is the difference between List and MutableList?
List is read-only and has no add or remove. MutableList adds them. Read-only isn’t the same as immutable: the underlying list could still be changed through another reference.
23. What is the difference between map and flatMap?
map turns each item into exactly one new item. flatMap turns each item into a collection, then joins all of them into one list.
fun main() {
val words = listOf("hi there", "kotlin")
println(words.map { it.split(" ") })
println(words.flatMap { it.split(" ") })
}Output:
[[hi, there], [kotlin]] [hi, there, kotlin]
24. What is a Sequence, and when should you use it?
A lazy collection: operations run item by item, only when a terminal operation like toList() or first() is called. Use asSequence() for long chains on large collections, or when you only need the first few results.
Coroutines and Flow
25. What is a coroutine?
A lightweight, suspendable piece of work. Thousands of coroutines can run on a few threads, because a suspended coroutine doesn’t block its thread. (Coroutines lesson)
26. What does suspend mean?
A suspend function can pause its coroutine (for example, while waiting for the network) and resume later without blocking the thread. It can only be called from a coroutine or another suspend function.
27. What is the difference between launch and async?
launch returns a Job and is used when you don’t need a result. async returns a Deferred<T>, and you get the result with await().
28. What are Dispatchers.Main, IO and Default?
Main is the UI thread. IO is for waiting work such as network, disk and database. Default is for CPU-heavy work. Switch with withContext(Dispatchers.IO) { … }. (Dispatchers lesson)
29. What is structured concurrency?
Every coroutine belongs to a scope. A scope waits for its children and cancels them when it’s cancelled, so coroutines can’t leak. viewModelScope and lifecycleScope tie coroutines to Android lifecycles.
30. What is the difference between Flow, StateFlow and SharedFlow?
A Flow is cold: it runs from the start for each collector. StateFlow is hot and always holds a current value, which makes it good for UI state. SharedFlow is hot and broadcasts values to current collectors, which suits one-off events. (Flow lesson)
How to prepare
- Go through the full Kotlin course and do the exercises. Typing the code helps you explain it in an interview.
- For Android roles, also revise Android interview questions for freshers and the MVVM architecture.
- Build one small project end to end (for example a notes or quiz app) and be ready to explain why you chose each part.
Keep reading



