LearnThatStack Ace your next interview
Mobile Development
Kotlin.
Change topic Change
Practice · Questions

All questions

Showing of 41
Beginner 10
01

Explain var vs val in Kotlin

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • val: Immutable reference (read-only), similar to final in Java. The reference cannot be reassigned, but the object itself may be mutable
  • var: Mutable reference, can be reassigned
val name = "John"        // Cannot be reassigned
var age = 25            // Can be reassigned
age = 26                // Valid
val list = mutableListOf(1, 2, 3)
list.add(4)             // Valid - object is mutable
// list = mutableListOf() // Error - reference is immutable
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What is type inference in Kotlin?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Type inference allows the compiler to automatically determine the type of a variable without explicit declaration. This reduces verbosity while maintaining type safety.

val name = "John"           // Inferred as String
val age = 25               // Inferred as Int
val price = 99.99          // Inferred as Double
val users = listOf<User>() // Explicit type needed for empty collections
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What are data classes in Kotlin and their benefits?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Data classes are classes specifically designed to hold data. The compiler automatically generates equals(), hashCode(), toString(), copy(), and destructuring declarations.

data class Person(val name: String, val age: Int)
val person1 = Person("Alice", 30)
val person2 = person1.copy(age = 31)  // Copy with modification
val (name, age) = person1             // Destructuring
println(person1)  // Automatically generated toString()

Requirements for data classes:

  • Primary constructor must have at least one parameter
  • All parameters must be marked as val or var
  • Cannot be abstract, open, sealed, or inner
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What are lambda expressions and their syntax?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Lambda expressions are anonymous functions that can be passed as arguments or stored in variables.

// Basic syntax: { parameters -> body }
val multiply = { a: Int, b: Int -> a * b }
// Single parameter - 'it' keyword
listOf(1, 2, 3).map { it * 2 }
// Trailing lambda syntax
listOf(1, 2, 3).filter { number ->
    number > 1
}
// Multiple parameters
mapOf("a" to 1, "b" to 2).forEach { (key, value) ->
    println("$key: $value")
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

Explain Kotlin's null safety features

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Kotlin's type system distinguishes between nullable and non-nullable types, eliminating null pointer exceptions at compile time.

var name: String = "John"    // Non-nullable
// name = null               // Compilation error
var nullableName: String? = "John"  // Nullable
nullableName = null                 // OK
// Safe call operator
val length = nullableName?.length
// Elvis operator
val displayName = nullableName ?: "Unknown"
// Not-null assertion (use carefully)
val definiteLength = nullableName!!.length
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What is the difference between safe call (?.) and not-null assertion (!!)?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Safe Call (?.): Returns null if the object is null, preventing null pointer exceptions.
Not-null Assertion (!!): Converts nullable type to non-nullable, throws exception if null.

val name: String? = getName()
// Safe call - returns null if name is null
val upperCase = name?.uppercase()
// Not-null assertion - throws KotlinNullPointerException if name is null
val definiteUpperCase = name!!.uppercase()
// Chaining safe calls
val result = person?.address?.street?.length
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

Explain the difference between mutable and immutable collections

Part of Pro
08

Explain the Android Activity lifecycle

Part of Pro
09

What are Intents and how are they used?

Part of Pro
10

Explain the difference between Activities and Fragments

Part of Pro
Intermediate 24
11

Explain Kotlin's when expression

Part of Pro
12

Explain primary and secondary constructors in Kotlin

Part of Pro
13

What are sealed classes and when would you use them?

Part of Pro
14

Explain object declarations and object expressions

Part of Pro
15

What are higher-order functions in Kotlin?

Part of Pro
16

Explain extension functions and their benefits

Part of Pro
17

How do you handle exceptions in Kotlin?

Part of Pro
18

What are useful collection operations in Kotlin?

Part of Pro
19

What are Kotlin coroutines and why are they important?

Part of Pro
20

Explain suspend functions in Kotlin

Part of Pro
21

How do you handle errors in coroutines?

Part of Pro
22

What is the Fragment lifecycle?

Part of Pro
23

What is ViewModel and why is it important?

Part of Pro
24

Explain LiveData and its benefits

Part of Pro
25

What is the Repository pattern in Android?

Part of Pro
26

Explain dependency injection and why it's useful

Part of Pro
27

How do you implement RecyclerView with different item types?

Part of Pro
28

What is data binding and how does it work?

Part of Pro
29

How do you handle different screen sizes and orientations?

Part of Pro
30

How do you optimize RecyclerView performance?

Part of Pro
31

How do you write unit tests for Kotlin Android code?

Part of Pro
32

What are instrumented tests and how do you write them?

Part of Pro
33

How do you handle deep linking in Android?

Part of Pro
34

What are some Kotlin best practices for Android development?

Part of Pro
Expert 7
35

What are coroutine scopes and contexts?

Part of Pro
36

How do you prevent memory leaks in Android?

Part of Pro
37

What are best practices for background processing?

Part of Pro
38

What are Kotlin Multiplatform projects?

Part of Pro
39

How do you implement custom views in Android?

Part of Pro
40

Explain Android app architecture patterns (MVVM, MVP, MVI)

Part of Pro
41

How do you implement offline-first architecture?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Kotlin? Send them this set.
Pro · $10/mo

35 of 41 Kotlin answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git