Android Native Interview Questions and Answers
100 Android Native interview questions across 14 topics: Kotlin Fundamentals, Android Fundamentals, UI & Layouts, Jetpack Compose, Architecture Components, Coroutines & Concurrency, Dependency Injection, Networking, Local Storage, Background Processing, Performance & Memory, Security & Obfuscation, Testing, and Build & Gradle. They cover Junior, Mid-level, and Senior levels, and every question has a short answer to give in the interview, a deeper explanation, common mistakes, and links to official documentation with a last-reviewed date.
Topics
Kotlin Fundamentals
12 questions
Android Fundamentals
10 questions
UI & Layouts
6 questions
Jetpack Compose
10 questions
Architecture Components
10 questions
Coroutines & Concurrency
10 questions
Dependency Injection
6 questions
Networking
6 questions
Local Storage
6 questions
Background Processing
5 questions
Performance & Memory
6 questions
Security & Obfuscation
4 questions
Testing
5 questions
Build & Gradle
4 questions
Kotlin Fundamentals Interview Questions (Android Native)
- What is the difference between val and var in Kotlin?
- What is the difference between const val and val in Kotlin?
- How does Kotlin's null safety system protect against NullPointerException?
- What is a data class in Kotlin and which methods does it generate automatically?
- How does smart cast work in Kotlin?
- What is the difference between a sealed class and an enum in Kotlin and when do we use each?
- How do extension functions work internally in Kotlin?
- What are the main differences between scope functions in Kotlin?
- What is a higher-order function in Kotlin?
- How do delegated properties work and what is the benefit of by lazy in Kotlin?
- What is the difference between inline, noinline, and crossinline in Kotlin?
- What is the benefit of the reified keyword in Kotlin and how does it get around type erasure?
Android Fundamentals Interview Questions (Android Native)
- What are the basic stages of the Activity lifecycle in Android and how does it move between them?
- What is the difference between the Fragment lifecycle and the Activity lifecycle and why do we use viewLifecycleOwner?
- What is the difference between Application Context and Activity Context and when do you use each?
- What is the difference between an explicit intent and an implicit intent in Android?
- What are the launch modes of an Activity and what is their effect on the back stack?
- What happens on a configuration change (such as screen rotation) and how do we preserve data?
- What is the role of a ContentProvider in Android's architecture and when do you need it?
- What is the difference between a statically registered and a dynamically registered BroadcastReceiver?
- What is the difference between full process death and the user closing the Activity?
- How do you apply the runtime permissions model in modern Android?
UI & Layouts Interview Questions (Android Native)
- What are the three basic stages of drawing any View on the screen in Android?
- What is the difference between ViewBinding and DataBinding in Android development?
- How does the ViewHolder pattern work inside RecyclerView and why is it effective?
- What is the benefit of DiffUtil and ListAdapter compared with calling notifyDataSetChanged()?
- How does ConstraintLayout help improve UI performance compared with nested LinearLayouts?
- How do you manage multi-touch events and touch interception in a custom ViewGroup?
Jetpack Compose Interview Questions (Android Native)
- What is Jetpack Compose and what is the difference between declarative and imperative UIs?
- What is recomposition in Jetpack Compose and how does it work efficiently?
- What is the state hoisting principle in Jetpack Compose?
- What is the difference between remember and rememberSaveable in Jetpack Compose?
- What are side effects in Compose and what is the difference between LaunchedEffect and DisposableEffect?
- What is the role of CompositionLocal in Jetpack Compose and when should it be used?
- When do we use derivedStateOf in Compose and why does it differ from remember(keys)?
- Why is the order of calling modifiers essential in Jetpack Compose?
- How do you ensure the best performance and smoothness for large lists in LazyColumn?
- How does Compose determine data stability to skip recomposition (smart skipping)?
Architecture Components Interview Questions (Android Native)
- What is the role of the ViewModel in the structure of Android apps and how does its lifecycle differ from the Activity's?
- What is the difference between LiveData and StateFlow and why is StateFlow preferred in modern Kotlin apps?
- What is the unidirectional data flow (UDF) pattern?
- What is the benefit of SavedStateHandle and how does it protect the app from process death?
- What is the architectural difference between MVVM and MVI in Android?
- What are the recommended Clean Architecture layers in Android and what is the direction of dependencies between them?
- How does the repository pattern achieve the single source of truth principle?
- Why is it recommended to use repeatOnLifecycle instead of launching lifecycleScope.launch directly when collecting Flow streams in the UI?
- How does Jetpack Navigation manage the back stack and complex deep links?
- What are the architectural components of the Paging 3 library and how does it manage advanced caching?
Coroutines & Concurrency Interview Questions (Android Native)
- What are coroutines in Kotlin and how do they differ from the operating system's traditional threads?
- How does a suspend function work under the hood in Kotlin?
- What is the difference between the dispatchers (Main, IO, Default, Unconfined) in Android?
- What is the difference between the launch coroutine builder and the async builder and when do we use each?
- What is the principle of structured concurrency in Kotlin coroutines?
- Why is it said that coroutine cancellation is cooperative and how do you make sure it responds?
- How are uncaught errors in coroutines handled using CoroutineExceptionHandler?
- What is the essential difference between a regular Job and a SupervisorJob in exception propagation?
- What is the architectural difference between a cold flow and a hot flow in Kotlin?
- When do you use Channel and when do you prefer Flow in the architecture of Android apps?
Dependency Injection Interview Questions (Android Native)
- What is dependency injection and what are the main benefits of applying it in Android?
- What is Hilt and what advantages does it offer over the Dagger 2 library for Android apps?
- What is the role of the basic annotations in Hilt: @HiltAndroidApp, @AndroidEntryPoint, and @Inject?
- What is the difference between @Provides and @Binds inside Module classes in Hilt?
- How does the component hierarchy and lifecycle scopes work in Hilt?
- How do you resolve the conflict of providing two different instances of the same type using qualifiers in Hilt?
Networking Interview Questions (Android Native)
- How does the Retrofit library work and what is the role of Converter.Factory and CallAdapter.Factory?
- What is the difference between an application interceptor and a network interceptor in the OkHttp library?
- Why is it preferred to use Moshi or Kotlinx Serialization instead of Gson in modern Kotlin code?
- How do you apply the Result pattern to wrap network responses and errors safely?
- What is SSL/certificate pinning and how is it implemented to protect the app from MITM attacks?
- How do you manage network caching (HTTP caching) and ETag support in Android?
Local Storage Interview Questions (Android Native)
- What are the three basic components of the Room library and what is the role of each?
- Why is it recommended to move from SharedPreferences to Jetpack DataStore?
- How do you store custom data types (such as dates or lists) in Room using TypeConverters?
- How do you handle upgrading the database schema (Room database migrations) without losing user data?
- How do you design relationships between tables (one-to-many and many-to-many) in Room?
- What is the difference between Preferences DataStore and Proto DataStore and when do you choose Proto DataStore?
Background Processing Interview Questions (Android Native)
- What are the types of services in Android and what is the essential difference between them?
- What is the architecture of WorkManager and why is it considered the recommended solution for guaranteed and deferred tasks?
- What is the difference between OneTimeWorkRequest and PeriodicWorkRequest and what is the minimum interval?
- What are the strict requirements for running a foreground service on modern Android versions (Android 14+)?
- How does the Android system manage power consumption through Doze mode and App Standby and what is their effect on background tasks?
Performance & Memory Interview Questions (Android Native)
- What is an ANR (Application Not Responding) error and what are its main causes and how do you trace it?
- What is a memory leak in Android and how does the LeakCanary tool help detect it?
- What is the difference between the app start types (cold, warm, hot start) and how do you improve cold start time?
- How do you manage image and bitmap memory in Android to avoid OutOfMemoryError (OOM) errors?
- How do you detect frame stutter (jank) and the causes of dropping below 60/120 FPS using Perfetto?
- What are baseline profiles and how do they speed up app startup and scroll smoothness by up to 30%?
Security & Obfuscation Interview Questions (Android Native)
- What is the Android Keystore system and what security advantage does it offer compared with ordinary key storage?
- What is the role of R8 in protecting the app and shrinking its size and what is the difference between shrinking and obfuscation?
- How do you implement biometric authentication using the unified BiometricPrompt library?
- How do you protect sensitive apps (such as banking apps) from tampering and rooted environments using the Play Integrity API?
Testing Interview Questions (Android Native)
- What is the testing pyramid in Android and what is the suggested ratio for each type?
- How do you test ViewModel logic using the MockK library and mocks?
- How do you test code that depends on coroutines using runTest and test dispatchers?
- What is the difference between Robolectric tests and real-device tests (instrumentation tests)?
- How do UI tests in Jetpack Compose work relying on the semantics tree?
Build & Gradle Interview Questions (Android Native)
- What are the three basic phases of the project build lifecycle in Gradle?
- How are build variants created by combining product flavors and build types in Gradle?
- What is the advantage of using Gradle version catalogs (the libs.versions.toml file) to manage dependencies?
- What are the best practices for splitting an Android app into multiple modules (multi-module architecture) and what is their effect on build speed?