Android Developer Interview Questions and Answers

Android Development with Kotlin: 21 Real Projects · Interview Preparation · 7 min read · Updated

A design answer in order

  1. Start by asking what the product must do and for how many users.
  2. Sketch the screens and the layers.
  3. Choose storage and network strategy, and where state lives.
  4. Finish with errors, offline behaviour, security, tests and scaling.

This lesson is a starting bank of questions that come up in Android interviews, with short model answers. It is not the full list of hundreds of questions that exist, so use it as a base: practise saying the answers aloud, and then give an example from your own projects for each one. Interviewers trust specific examples more than definitions.

Kotlin

  • val vs var vs const val? val is read-only, var is reassignable, const val is a compile-time constant of a primitive or String at top level or in an object.
  • What is null safety? Types are non-null by default. String? allows null; you use ?., ?:, let or an explicit check, and avoid !!.
  • data class vs class? A data class generates equals, hashCode, toString, copy and componentN from its primary constructor properties.
  • What is a sealed class? A restricted hierarchy known at compile time, so a when can be exhaustive. Used for UI state and results.
  • Extension functions? Add functions to a type without inheriting from it. They are resolved statically.
  • inline, noinline, crossinline? inline copies the function and lambdas into the caller to avoid allocations; noinline opts a lambda out; crossinline forbids non-local returns from it.
  • lateinit vs lazy? lateinit var is set later and throws if read too early. lazy computes a val on first use, thread-safe by default.
  • object vs companion object? object is a singleton. A companion object holds members tied to a class.
  • What are scope functions? let, run, with, apply and also; they differ in this or it and in what they return.
  • List vs MutableList vs Array? List is read-only view, MutableList can change, Array is fixed size and maps to a JVM array.

Android basics

  • Activity lifecycle? onCreate, onStart, onResume, onPause, onStop, onDestroy. Rotation recreates the Activity.
  • How do you save state across rotation? ViewModel, rememberSaveable, or SavedStateHandle. For process death, SavedStateHandle or a database.
  • Fragment vs Activity? An Activity is a window; a Fragment is a reusable UI part with its own lifecycle inside it.
  • Explicit vs implicit intent? Explicit names the component; implicit describes an action and lets the system choose.
  • Service types? Started, bound and foreground; use WorkManager for deferrable background work.
  • What is a ContentProvider? A way to share structured data between apps through URIs.
  • Context types? Application context lives with the process; Activity context with the screen. Avoid leaking an Activity context.
  • What is an ANR and how do you avoid it? The main thread was blocked too long. Move disk, network and heavy work to background coroutines.
  • What is the manifest for? Declares components, permissions, app metadata and intent filters.
  • How do runtime permissions work? Dangerous permissions are requested with the Activity Result API; handle denial and explain why you ask.

Jetpack Compose

  • What is recomposition? Compose re-runs composables whose state input changed. They must be fast and free of side effects.
  • remember vs rememberSaveable? remember survives recomposition; rememberSaveable also survives recreation.
  • What is state hoisting? Moving state up and passing value and callbacks down so the composable is stateless.
  • LaunchedEffect vs DisposableEffect vs SideEffect? Run a suspend block keyed to values; register and clean up; publish state to non-Compose code after each composition.
  • derivedStateOf? Computes state from other state and only notifies when the result changes.
  • Why use keys in LazyColumn? Stable identity for items when the list changes, preserving state and animations.
  • How do you avoid unnecessary recomposition? Stable parameters (immutable data classes), keys, reading state late, and checking with the Layout Inspector.
  • Modifier order matters, why? Each modifier wraps the one after it, so padding before background differs from after.
  • Compose vs XML? Compose is declarative and has less code; XML is imperative and still widespread in older apps.

Coroutines and Flow

  • Dispatchers? Main for UI, IO for disk/network, Default for CPU work.
  • launch vs async? launch returns a Job; async returns a Deferred value for parallel work.
  • What is structured concurrency? Child coroutines are bound to a scope; cancelling the scope cancels them.
  • How does cancellation work? Cooperative; suspending functions check it, long loops should call ensureActive.
  • Flow vs LiveData? Flow is a Kotlin stream with operators and is not tied to Android; LiveData is lifecycle-aware but simple.
  • Cold vs hot flows? A cold Flow starts per collector; StateFlow and SharedFlow are hot and exist without collectors.
  • StateFlow vs SharedFlow? StateFlow always holds a current value and replays it; SharedFlow has no initial value and configurable replay.
  • What does stateIn with WhileSubscribed do? Shares a flow as state and stops upstream work shortly after the last collector leaves.

Architecture, data and networking

  • MVVM? ViewModel holds state and logic; the view observes and sends events. Fits Compose with UDF.
  • Clean Architecture? Presentation, domain and data layers with dependencies pointing to the domain.
  • Repository pattern? One source for data that hides network and database.
  • What is dependency injection and why Hilt? Objects are provided from outside, which improves testing and structure; Hilt generates the wiring.
  • Room vs DataStore? Room for relational data and queries; DataStore for small settings or typed objects.
  • How do you make an app offline-first? Room is the source of truth; the repository refreshes it from the network.
  • How does Retrofit work? An annotated interface becomes an HTTP client; OkHttp does the requests; converters turn JSON into objects.
  • How do you handle token refresh? An OkHttp Authenticator that gets a new token and retries once.
  • Pagination? Paging 3 with a PagingSource and a Pager; handle load states.
  • How would you secure stored tokens? Encrypt with a Keystore key and keep them out of logs and backups.

Performance, testing and release

  • How do you find memory leaks? LeakCanary and the Memory Profiler; look for long-lived references to Activities.
  • How do you speed up startup? Defer initialisation, App Startup, splash screen API and Baseline Profiles.
  • What do you test? Pure functions, ViewModels with fakes, repositories, and key UI flows. Use JUnit, MockK, Turbine and Compose test rules.
  • What does R8 do? Shrinks, optimises and obfuscates; add keep rules for reflection.
  • APK vs AAB? AAB is the upload format; Play creates optimised APKs per device.
  • How do you ship safely? CI, internal testing, staged rollout, and watching Android vitals and crash reports.

Scenario and system design questions

For design questions, answer in a fixed order: clarify requirements, list screens, draw the layers, choose storage and network strategy, explain state handling, then talk about errors, offline behaviour, security, testing and scaling. Practise with these prompts.

  • Design a chat app: Firestore or WebSocket, local cache with Room, message states (sending, sent, failed), push for background, pagination of history, and read receipts.
  • Design a news feed with infinite scroll: Paging 3 with a RemoteMediator, Room as source of truth, image caching, and pull to refresh.
  • Design an e-commerce cart: local cart in Room, server price validation, checkout via your server and a payment SDK, and idempotent order requests.
  • A screen is janky when scrolling. Walk through measuring, finding recomposition or main-thread work, and fixing.
  • Users report the app crashes on one phone model. Use Crashlytics or Play vitals, reproduce on an emulator with the same API level, read the trace and add a regression test.
  • How would you migrate a large XML app to Compose? One screen at a time, ComposeView interop, shared design tokens, and tests around each migrated screen.

Coding and machine-coding rounds

Machine-coding rounds ask you to build a small app in an hour or two, such as a to-do list, a quiz, a tip calculator or a paginated list from an API. Your projects in this course are exactly that practice. In the round: clarify, sketch the UiState, write a ViewModel and a simple screen, handle empty, loading and error states, then add tests if time allows. Keep the code readable, and say what you would improve with more time. Common coding questions cover strings, arrays, hash maps, two pointers, recursion and basic trees, so practise on a coding site in Kotlin.

Your task

  1. Pick ten questions and record yourself answering them in under a minute each.
  2. For each answer, add one example from your own projects.
  3. Rebuild the tip calculator from memory in 45 minutes and note what slowed you down.
  4. Prepare a two-minute description of your best project: problem, architecture, one hard bug, and what you would do next.

How to check it worked

  • You can answer the Kotlin and Compose questions without notes.
  • You have a project story for architecture and for performance.
  • You follow a fixed order in system design answers.

Frequently asked questions

How many questions should I prepare?

Cover each topic area in depth rather than memorising hundreds. Be able to explain why, and to show an example from your own code.

What if I do not know an answer?

Say what you do know, reason aloud from first principles and say how you would look it up. Honesty and clear thinking score better than guessing.

Should I use Compose or XML in a machine-coding round?

Use Compose unless the interviewer asks otherwise, and be ready to explain the XML equivalent.