1. What is Kotlin?
- A modern, statically-typed programming language that runs on JVM
- A JavaScript framework
- A database management system
- An operating system
Correct Answer: A modern, statically-typed programming language that runs on JVM
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
Kotlin · Complete Question Bank
Practice the complete collection of Kotlin interview questions including theory, coding, MCQs and real interview problems.
Questions
81
Full database
Topics
39
Categorised
Difficulty
Mixed Levels
Easy Hard
Scroll through every important Kotlin question asked in real interviews. Includes MCQs, subjective questions, and coding prompts.
Correct Answer: A modern, statically-typed programming language that runs on JVM
Browse more Kotlin questions, explore related subjects, or practice full interview sets to strengthen your preparation.
Correct Answer: val is immutable (read-only) and var is mutable
Correct Answer: It makes the type nullable, allowing null values
Correct Answer: Using $ symbol like "Hello $name"
Correct Answer: The compiler automatically determines the type of a variable from its initializer
Correct Answer: Returns the left value if not null, otherwise returns the right value
Correct Answer: It returns null instead of throwing NullPointerException
Correct Answer: Converts nullable type to non-nullable, throws NPE if null, use sparingly when certain value is not null
Correct Answer: fun functionName(params): ReturnType { }
Correct Answer: Assign values directly in parameter list like fun greet(name: String = "Guest")
Correct Answer: Functions that add new functionality to existing classes without inheritance
Correct Answer: A function that takes functions as parameters or returns a function
Correct Answer: { parameters -> body } enclosed in curly braces
Correct Answer: when is an expression returning values, more powerful, and doesn't need break statements
Correct Answer: Use .. operator like 1..10 for inclusive range
Correct Answer: Makes code more readable and allows skipping default parameters
Correct Answer: class ClassName { } or class ClassName for empty class
Correct Answer: A constructor declared in the class header with optional init block
Correct Answer: equals(), hashCode(), toString(), copy(), and componentN() functions
Correct Answer: Restrict class hierarchies to a limited set of types known at compile time
Correct Answer: A singleton implementation where the object keyword creates a single instance
Correct Answer: An object inside a class whose members can be called using the class name
Correct Answer: public - visible everywhere
Correct Answer: Mark the class with the open keyword
Correct Answer: List, Set, and Map - each with mutable and immutable versions
Correct Answer: Use listOf() function
Correct Answer: Transforms each element and returns a new collection with the results
Correct Answer: A new collection containing only elements matching the predicate
Correct Answer: Lazy evaluation - operations are only performed when results are needed
Correct Answer: let passes object as 'it' and returns lambda result, apply uses 'this' and returns the object
Correct Answer: fold requires an initial value, reduce uses first element as initial value
Correct Answer: groupBy - returns a Map of key to list of elements
Correct Answer: Lightweight threads that allow writing asynchronous code in a sequential style
Correct Answer: The function can be paused and resumed, callable only from coroutines or other suspend functions
Correct Answer: launch returns Job for fire-and-forget, async returns Deferred for getting results
Correct Answer: A cold asynchronous stream that emits values sequentially
Correct Answer: Delays property initialization until first access with thread-safe caching
Correct Answer: out for covariance (producers), in for contravariance (consumers)
Correct Answer: Preserves type information at runtime for generic type parameters
Correct Answer: StateFlow always has a current value and replays it to new subscribers, SharedFlow is more configurable