Top 30 Android Interview Questions and Answers
30 multiple-choice questions on Android, drawn from 30 bites out of the 433 tagged Android on Tezvyn. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
In Kotlin, what does declaring a variable with val guarantee about the referenced object?
Show the answer
Answer: c · The reference cannot be reassigned, though the object's contents may still mutate
val only prevents reassigning the reference itself, so a val holding a MutableList can still be modified. The most tempting distractor confuses reference immutability with deep object immutability, which val does not enforce.
Read the full bite: Explain val vs var in Kotlin and null safety risks
Question 2 of 30
Following the I/O 2026 platform pivot, what architectural shift should senior engineers prioritize to avoid building obsolete Android apps?
Show the answer
Answer: c · Exposing granular business capabilities through AppFunctions and designing for agent orchestration instead of static screens
The card states that screens and intents are giving way to agent functions and AppFunctions, which expose discrete app capabilities to the OS intelligence layer for system-wide orchestration. Option A is tempting because preserving traditional intent-based screens feels architecturally safe, but the card explicitly warns that treating this pivot as a marketing refresh risks building obsolete architectures within two release cycles.
Read the full bite: Android Becomes an Intelligence System: I/O 2026 Recap
Question 3 of 30
A developer needs to store a user's current score in a game, which will change throughout gameplay. Which Kotlin keyword should be used?
Show the answer
Answer: c · var
The card states that 'var' should be used for values that need to be reassigned, such as a user's score, while 'val' is for values that remain constant after initial assignment. Choosing 'val' here would lead to a compilation error when trying to update the score.
Read the full bite: Kotlin Variables: `val` for Constants, `var` for Variables
Question 4 of 30
When adding a new implicit dependency such as a Logger to a deep call chain, what is the main benefit of Kotlin 2.4.0 stable context parameters?
Show the answer
Answer: a · They let the compiler pass the dependency implicitly through the call stack, avoiding changes to every intermediate function signature.
Stable context parameters allow the compiler to implicitly pass dependencies through call chains, eliminating the need to refactor every intermediate signature when adding a new implicit dependency. Option C describes explicit backing fields, a separate Kotlin 2.4.0 feature for property storage shapes, not dependency threading.
Read the full bite: Kotlin 2.4.0 Ships Stable Context Parameters and UUID API
Question 5 of 30
What is the main advantage of Kotlin's approach to null safety with default non-nullable types?
Show the answer
Answer: d · It shifts the detection of potential NullPointerExceptions from runtime to compile time.
Kotlin's type system is explicitly designed to prevent NullPointerExceptions (NPEs) at compile time, a major benefit over languages that only catch them at runtime. Option B is a common misconception; val declares a read-only reference, not necessarily a compile-time constant.
Read the full bite: Explain val, var, and null safety in Kotlin
Question 6 of 30
Given the Kotlin declaration `val userNames = mutableListOf("Alice")`, which statement accurately describes the `userNames` variable?
Show the answer
Answer: d · The variable `userNames` cannot be reassigned, but the list it points to can be modified.
The `val` keyword creates a read-only reference, meaning the `userNames` variable cannot be reassigned. However, the `mutableListOf` object it points to is still mutable, allowing its contents to be changed. A common misconception is that `val` makes the object itself immutable.
Read the full bite: Explain val vs. var and null safety in Kotlin
Question 7 of 30
Which migration step should teams prioritize first to reduce memory leaks when unifying Android reactive streams?
Show the answer
Answer: d · Replace unsafe lifecycle subscriptions with lifecycle-aware coroutine scopes like viewModelScope
The card identifies replacing unsafe lifecycle subscriptions with scopes such as viewModelScope as the top priority for high-leak surfaces. Mapping operators first does not fix the lifecycle mismatches that directly cause undisposed subscriptions and memory leaks.
Read the full bite: Unify Android EventBus and RxJava with Kotlin Flow
Question 8 of 30
What is the main engineering benefit of Android CLI 1.0 reaching stable for CI/CD workflows?
Show the answer
Answer: b · It enables project scaffolding, device management, and builds to run without Android Studio on headless agents.
Android CLI 1.0 stable exposes first-party terminal commands for scaffolding, device management, and builds, eliminating the need to install Android Studio on headless CI agents. Option C describes Android skills, a separate I/O feature for AI assistant integration.
Read the full bite: Android CLI 1.0 Stable Unlocks Headless CI
Question 9 of 30
How does the 2026 server-driven UI approach announced at I/O fundamentally differ from traditional server-driven UI patterns?
Show the answer
Answer: d · It replaces hand-authored JSON schemas with AI-generated UI descriptions sent from the server.
The card states that server-driven interfaces are evolving from manually written JSON schemas to AI-generated UI descriptions, removing the authoring bottleneck. Distractor D is wrong because the server still sends structured UI descriptions; the AI generates them remotely, not on the device.
Read the full bite: I/O 2026 Standardizes AI Server-Driven UI for Android
Question 10 of 30
What is the primary drawback of keeping isCoreLibraryDesugaringEnabled enabled for an app whose user base has largely migrated to API 26+ devices?
Show the answer
Answer: d · It subjects newer devices to an unnecessary runtime performance penalty via the j$ namespace shim.
The card states that the j$ backport levies a hidden performance tax on modern flagship devices, hurting startup and runtime efficiency. Option B misleads readers who recall the mention of native kernel hooks, but the card explicitly says the backport is stripped of them.
Read the full bite: isCoreLibraryDesugaringEnabled Nears End of Life
Question 11 of 30
When migrating to Koog 1.0, how should teams handle the stable and beta module split to align with JetBrains' support guarantees?
Show the answer
Answer: c · Move core dependencies to stable modules while isolating beta features to specific use cases
Koog 1.0 guarantees one year of API stability only for stable core modules, so teams should migrate core dependencies there while isolating beta features to specific use cases. Option B is tempting but wrong because the framework explicitly supports adding beta features as needed rather than avoiding them entirely.
Read the full bite: Koog 1.0 Stabilizes Kotlin AI Agent Framework
Question 12 of 30
What is the main benefit of Swift package support in Kotlin/Native for multiplatform teams?
Show the answer
Answer: c · It lets teams consume Apple ecosystem dependencies directly instead of maintaining bridging wrappers or CocoaPods workarounds.
The card states that Swift package support allows pulling Apple dependencies directly, eliminating the need for bridging wrappers or CocoaPods workarounds. Option B is tempting because it mentions CocoaPods, but the feature provides an alternative rather than forcing a migration.
Read the full bite: Kotlin 2.4.0 ships Swift package support and Java 26
Question 13 of 30
If user is null, what happens when evaluating user?.name ?: "Guest"?
Show the answer
Answer: b · It returns Guest without throwing an exception
The safe call operator ?. returns null when user is null, and the Elvis operator ?: then substitutes Guest as the fallback. Option C is tempting because ?. does preserve nullability, but it ignores that ?: immediately provides the default value.
Read the full bite: What do the safe call and Elvis operators do in Kotlin?
Question 14 of 30
Given a nullable `user: User?`, how do you safely get its name's length, returning 0 if either `user` or its `name` property is null?
Show the answer
Answer: d · user?.name?.length ?: 0
The safe call `?.` accesses properties only if the object is not null, and the Elvis operator `?:` provides the default value `0` if the preceding expression is null. The `if/else` block is verbose and not idiomatic Kotlin.
Read the full bite: Purpose of Kotlin's safe call (`?.`) and Elvis (`?:`) operators?
Question 15 of 30
Given `data class User(val name: String?)` and a nullable `val activeUser: User?`, which Kotlin expression correctly retrieves the user's name, providing "Guest" if `activeUser` is null or its `name` property is null?
Show the answer
Answer: d · activeUser?.name ?: "Guest"
Option D correctly uses the safe call operator (?. ) to access 'name' only if 'activeUser' is not null, and then the Elvis operator (?: ) to provide "Guest" if the result is null. Option C, while functionally correct, is considered non-idiomatic Kotlin as it uses a verbose if/else block instead of the more concise and expressive ?. and ?: operators.
Read the full bite: Purpose of safe call (`?.`) and Elvis (`?:`) operators
Question 16 of 30
What is the main consequence of using the not-null assertion operator (!!) in Kotlin?
Show the answer
Answer: b · It tells the compiler to trust that a value is not null, potentially leading to a runtime NullPointerException if it is.
The not-null assertion operator (!!) bypasses Kotlin's compile-time null safety, forcing the compiler to assume a value is non-null. If the value turns out to be null at runtime, it will result in a NullPointerException, defeating the purpose of Kotlin's null safety. Option A is incorrect because it introduces risk, and options C and D describe the Elvis operator (?:) and safe call operator (?.), respectively.
Read the full bite: Kotlin Null Safety: Catch Nulls at Compile Time
Question 17 of 30
What is a mandatory requirement when using an `if` expression to assign a value to a variable in Kotlin?
Show the answer
Answer: b · An `else` branch must always be present to cover all possible outcomes.
When `if` is used as an expression, it must always return a value. To guarantee this, the compiler requires an `else` branch to cover all possible cases. The last line of a branch implicitly becomes its return value, without needing an explicit `return` keyword.
Read the full bite: Kotlin's Control Flow Expressions: `if` and `when`
Question 18 of 30
If a class has a member function and an extension function is defined with the same signature, which one will be invoked when called on an instance of that class?
Show the answer
Answer: b · The member function, because member functions always take precedence.
When a member function and an extension function have the same signature, the member function will always be chosen. This is because extension functions are resolved statically and do not override class members, making the member function the more specific choice.
Read the full bite: What is a Kotlin extension function? Write one for String.
Question 19 of 30
Which statement accurately describes the underlying mechanism of Kotlin extension functions?
Show the answer
Answer: c · They are compiled into static utility methods where the receiver object is passed as the first parameter.
The card explicitly states that extension functions are "syntactic sugar for static utility methods" and are "compiled down to static methods that take the receiver object as the first argument." They do not modify the original class or its bytecode, which is a common misconception.
Read the full bite: What is a Kotlin extension function? Write one for String.
Question 20 of 30
What is the main purpose of using functions in Kotlin?
Show the answer
Answer: d · To package reusable logic, preventing code duplication and enhancing structure.
The card states functions exist "to solve the problem of code repetition and disorganization" by packaging logic into "a single, named block that can be called from anywhere." Option C is incorrect because while good code structure can aid optimization, functions' primary role isn't automatic speed enhancement.
Read the full bite: Kotlin Functions: Named, Reusable Code Blocks
Question 21 of 30
When a native module method reads a live device value to return to JavaScript, why should it use a Promise or callback rather than a direct return?
Show the answer
Answer: d · Because crossing the native-to-JS boundary is asynchronous, so results are delivered via promise or callback
Values crossing from native into JavaScript are delivered asynchronously, so a Promise or callback is the correct pattern. Native code can return constants synchronously via getConstants, and package registration is unrelated to whether methods are async.
Question 22 of 30
When working with immutable state in Kotlin, which generated function of a data class is specifically designed to create a new object instance with modified properties without altering the original?
Show the answer
Answer: b · copy()
The copy() function is specifically designed to create a new instance of the data class, allowing certain properties to be modified while leaving the original object unchanged, which is crucial for immutable state management. The other generated functions serve different purposes like comparison, string representation, or hash generation, not for creating modified copies.
Read the full bite: What are the advantages of a Kotlin data class and its functions?
Question 23 of 30
When managing immutable state with a data class, what is the primary role of the generated `copy()` function?
Show the answer
Answer: b · To create a new, modified instance of the object, leaving the original unchanged.
The `copy()` function is central to working with immutable objects; it creates a new instance with specified changes, leaving the original untouched. Option A is a critical misunderstanding, as `copy()` never mutates the original object, which is key to predictable state management.
Read the full bite: What are the advantages of a Kotlin data class?
Question 24 of 30
When using a Kotlin data class as a key in a HashMap, which statement about its compiler-generated behavior is true?
Show the answer
Answer: b · Only properties defined in the primary constructor marked as val or var are used in generated equals and hashCode, so the key remains consistent in the map.
The compiler only incorporates primary constructor properties marked val or var into generated equals and hashCode, guaranteeing the contractual consistency required for safe use as a HashMap key. Option C is a tempting distractor because developers often assume body properties participate in structural equality, but the compiler intentionally excludes them.
Read the full bite: What are the primary advantages of using a data class?
Question 25 of 30
What is the primary reason Kotlin classes are final by default?
Show the answer
Answer: a · To encourage explicit design for inheritance and promote composition over inheritance.
The card states that Kotlin's design makes inheritance an intentional act to encourage more robust code and promotes composition over inheritance. Option A directly captures these core reasons. Option C is incorrect as 'final by default' relates to inheritance, not the mutability of properties, which is controlled by 'val' and 'var'.
Read the full bite: Kotlin Inheritance: Open for Extension, Closed by Default
Question 26 of 30
An Android Fragment needs a property for a complex, computationally expensive object that is only used in certain user flows. The object should be created only once. Which declaration is most appropriate?
Show the answer
Answer: b · private val myObject: MyObject by lazy { createExpensiveObject() }
`val by lazy` is ideal for expensive, immutable properties because it defers creation until first access and caches the result. `lateinit var` is incorrect because the property is immutable and is meant for when an external framework provides the value, not for deferred computation.
Question 27 of 30
Which statement accurately describes a fundamental difference between lateinit var and val by lazy in Kotlin?
Show the answer
Answer: b · val by lazy can initialize properties of any type, including primitives, unlike lateinit var.
The card states that lateinit var cannot be used for primitive types like Int or Boolean, while val by lazy has no such restriction. Option A is incorrect because it describes the behavior of val by lazy, not lateinit var, which is initialized manually.
Question 28 of 30
In an Activity, a property holds a ViewModel obtained via ViewModelProvider in onCreate. Why is lateinit var more suitable than val by lazy?
Show the answer
Answer: c · lateinit var allows imperative assignment and can be reassigned if the Activity is recreated
lateinit var is designed for mutable properties assigned imperatively in lifecycle callbacks like onCreate and can be reassigned when the Activity is recreated, whereas val by lazy is immutable and self-initializing. Option D is tempting but wrong because it describes lazy's first-access caching behavior, not lateinit's imperative assignment model.
Read the full bite: Explain lateinit var versus val by lazy in Android
Question 29 of 30
Which statement accurately describes the behavior of the copy() method generated for a Kotlin data class?
Show the answer
Answer: d · It performs a shallow copy, meaning references to mutable objects within the data class are shared between the original and the new instance.
The card explicitly states that the copy() function creates a shallow copy. This means if a data class contains a mutable object, both the original and the copied instance will refer to the same mutable object. Option A is a common misconception, as many expect a copy function to perform a deep copy for safety.
Read the full bite: Kotlin Data Classes: Automatic Boilerplate for Data Holders
Question 30 of 30
In Kotlin, what is the defining characteristic that makes a function a 'higher-order function'?
Show the answer
Answer: b · It accepts a function as an argument or returns a function as its result.
The correct answer is right because the definition of a higher-order function is one that treats functions as first-class citizens by taking them as parameters or returning them. While many higher-order functions operate on collections (a tempting distractor), this is a common use case, not the defining property.
Read the full bite: Explain and implement a higher-order function in Kotlin
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.