Arun Bhardwaj
30 Dec 2025
Top 50 Android Kotlin Interview Questions and Answers
Top 50 Android Kotlin interview questions and answers with clear explanations and practical code examples.
Top 50 Android Kotlin Interview Questions and Answers
1. What are the advantages of Kotlin over Java for Android development?
•Kotlin makes Android development easier and cleaner compared to Java. You can write less code to do the same work.
•It has built-in support for handling null values, which helps avoid common mistakes.
•Kotlin also works very well with Java, so you can use both in the same project.
data class User(val id: Int, val name: String)2. What is null safety in Kotlin?
•Null safety helps you handle null values in a safe way.
•In Kotlin, variables are non-null by default. If a variable can be null, you must clearly mention it.
•This helps you think about null cases while writing code.
var name: String? = null
var title: String = "Android"
name?.length3. Difference between val and var in Kotlin?
•val is used when the value should not change after it is set.
•var is used when the value needs to change later.
val appName = "MyApp"
var count = 0
count = 14. What is lateinit in Kotlin?
•lateinit is used when a variable will be initialized later.
•It is mostly used in Android for views, ViewBinding, or injected objects.
•It helps avoid nullable variables.
lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
binding = ActivityMainBinding.inflate(layoutInflater)
}5. What is lazy in Kotlin?
•lazy is used when you want to create an object only when it is needed.
•This is useful for objects that are not always used.
val adapter by lazy {
UserAdapter()
}6. ifference between lateinit and lazy?
•lateinit is used with var and needs manual initialization.
•lazy is used with val and initializes automatically when first used.
7. What is the Android Activity lifecycle?
•The Activity lifecycle describes the different states of an Activity.
•These states help Android manage screens properly.
override fun onPause() {
super.onPause()
}8. Difference between Activity and Fragment?
•Activity is a full screen in an app.
•Fragment is a smaller part of a screen and lives inside an Activity.
supportFragmentManager.beginTransaction()
.replace(R.id.container, MyFragment())
.commit()9. What is Context in Android?
•Context gives access to app resources and system services.
•It is commonly used to show Toasts or access resources.
Toast.makeText(this, "Hello", Toast.LENGTH_SHORT).show()10. What are Coroutines in Kotlin?
•Coroutines help run tasks in the background.
•They keep the app smooth while doing work like network calls.
lifecycleScope.launch {
val data = loadData()
}11. ifference between launch and async?
•launch is used when you do not need a result.
•async is used when you want a result.
val result = async { getData() }.await()12. What is ANR?
•ANR happens when the app does not respond for some time.
•This usually happens when heavy work runs on the main thread.
withContext(Dispatchers.IO) {
loadData()
}13. What is ViewBinding?
•ViewBinding allows you to access views without findViewById.
•It makes code safer and cleaner.
binding.textView.text = "Hello"14. Difference between ViewBinding and DataBinding?
•ViewBinding only gives view references.
•DataBinding allows connecting UI with data directly.
15. What is RecyclerView?
•RecyclerView is used to show large lists.
•It reuses views to improve performance.
recyclerView.adapter = UserAdapter(list)16. What is DiffUtil?
•DiffUtil finds changes between two lists.
•It updates only changed items.
DiffUtil.calculateDiff(callback)17. What is ViewModel?
•ViewModel stores UI data.
•It keeps data during screen rotation.
val vm: MainViewModel by viewModels()18. What is MVVM?
•MVVM is a way to organize code.
•It separates UI, logic, and data.
19. What is Room database?
•Room helps work with SQLite easily.
•It checks queries at compile time.
@Query("SELECT * FROM user") fun getUsers(): List<User>20. What is Hilt?
•Hilt helps provide required objects automatically.
•It reduces manual setup code.
@HiltAndroidApp
class MyApp : Application()21. What is Intent in Android?
•Intent is used to move from one screen to another or to pass data between components.
•It is commonly used to open Activities.
startActivity(Intent(this, DetailActivity::class.java))22. Difference between explicit and implicit Intent?
•Explicit Intent opens a specific screen inside the app.
•Implicit Intent lets the system choose an app that can handle the action.
Intent(Intent.ACTION_VIEW, Uri.parse("https://google.com"))23. What is Service in Android?
•Service is used to run work in the background without showing any UI.
•It is often used for music playback or long tasks.
class MyService : Service() {
override fun onBind(intent: Intent?) = null
}24. What is BroadcastReceiver?
•BroadcastReceiver listens for system or app events.
•It reacts when the event happens, like network change.
class MyReceiver : BroadcastReceiver() {
override fun onReceive(c: Context, i: Intent) {}
}25. What is WorkManager?
•WorkManager is used for background work that should run even if the app is closed.
•It is good for tasks like syncing data.
WorkManager.getInstance(context).enqueue(workRequest)26. What is JobScheduler?
•JobScheduler schedules background tasks based on conditions.
•It helps save battery and system resources.
27. What is Dependency Injection?
•Dependency Injection provides objects instead of creating them manually.
•It makes code easier to manage and test.
28. What is Hilt in Android?
•Hilt is a library that helps with Dependency Injection.
•It reduces setup code and works well with ViewModel.
@AndroidEntryPoint
class MainActivity : AppCompatActivity()29. What is Gradle?
•Gradle is the build system used in Android projects.
•It handles dependencies and builds the app.
30. What is minSdk and targetSdk?
•minSdk is the lowest Android version your app supports.
•targetSdk tells Android which version your app is designed for.
31. What is Android App Bundle (AAB)?
•AAB is a format used to publish apps on Play Store.
•It helps users download only what their device needs.
32. What is ProGuard / R8?
•ProGuard and R8 reduce app size by removing unused code.
•They also make the code harder to read when decompiled.
33. How do you improve app performance?
•Move heavy work to background threads.
•Use RecyclerView properly and avoid heavy layouts.
34. What causes memory leaks in Android?
•Keeping references to Activity for a long time.
•Long-running background tasks.
35. What is Jetpack Compose?
•Jetpack Compose is a modern way to build UI using Kotlin.
•It removes the need for XML layouts.
@Composable
fun Greeting() {
Text("Hello")
}36. XML vs Jetpack Compose?
•XML uses layout files, while Compose uses Kotlin code.
•Compose needs less boilerplate.
37. What is state in Compose?
•State holds data that controls the UI.
•When state changes, UI updates.
var count by remember { mutableStateOf(0) }38. What is remember in Compose?
•remember keeps values during recomposition.
•It helps avoid resetting values.
39. What is recomposition?
•Recomposition updates the UI when data changes.
•Only the affected parts are redrawn.
40. What is unit testing?
•Unit testing checks small parts of the code.
•It helps ensure logic works as expected.
@Test fun addTest() { assertEquals(4, 2+2) }41. What is Espresso in Android?
•Espresso is a tool used to test Android UI.
•It checks if buttons, text, and screens work as expected.
onView(withId(R.id.button)).perform(click())42. What is MockK?
•MockK is a library used to create fake objects for testing.
•It is designed specially for Kotlin.
val repo = mockk<UserRepository>()43. What is Firebase?
•Firebase provides backend services like authentication, database, and analytics.
•It helps build apps faster without managing servers.
44. What is REST API?
•REST API allows the app to communicate with a server.
•It is commonly used to fetch or send data.
@GET("users") suspend fun getUsers(): List<User>45. What is Retrofit?
•Retrofit is a library used to call APIs easily.
•It works well with coroutines.
val retrofit = Retrofit.Builder().baseUrl(BASE_URL).build()46. What is pagination?
•Pagination loads data in small parts instead of loading everything at once.
•It improves performance for large lists.
47. What is Paging 3 library?
•Paging 3 helps load paged data in RecyclerView.
•It handles loading more data automatically.
Pager(PagingConfig(pageSize = 20)) { pagingSource }48. What is SharedPreferences?
•SharedPreferences is used to store small key-value data.
•It is often used for settings or flags.
prefs.edit().putString("name", "Arun").apply()49. What is Jetpack Navigation?
•Navigation helps move between screens in a structured way.
•It reduces manual fragment transactions.
50. How should a beginner prepare for Android interviews?
•Focus on Kotlin basics and Android fundamentals.
•Build small projects and understand how things work.
•Practice explaining your code in simple words.
Recommended Tutorials
Jetpack Compose: Modern UI Toolkit for Android
Jetpack Compose simplifies Android UI development using declarative programming with less code, reactive state management, and modern design principles.
MVVM Architecture in Android with Kotlin
Learn MVVM architecture in Android using Kotlin. Understand Model, View, ViewModel, LiveData, and how MVVM helps you build clean, scalable, and testable Android apps.
Top 50 Android Java Interview Questions and Answers
Top 50 Android Java interview questions and answers with simple explanations and practical examples.
Top 25 ExoPlayer Interview Questions and Answers
Top 25 ExoPlayer interview questions and answers with clear explanations and practical Android examples.