Master Kotlin/Android interviews with 45+ questions on coroutines, Jetpack, and modern Android development.
Nullable types require explicit declaration (String?). Safe call operator (?.) returns null if receiver is null. Elvis operator (?:) provides default value. Not-null assertion (!!) throws if null (avoid). let/also for null checks. lateinit for non-null initialization after construction. Compiler enforces null safety at compile time, eliminating NullPointerExceptions.
val: read-only (immutable reference), can be initialized at runtime. var: mutable, can be reassigned. const val: compile-time constant, must be primitive or String, top-level or object member. Best practice: prefer val (immutability), use var only when mutation needed. val objects can have mutable properties (shallow immutability).
Coroutines: lightweight threads for async programming. Benefits: sequential code style for async operations, structured concurrency, cancellation support, no callback hell. Key concepts: suspend functions, CoroutineScope, Dispatchers (Main, IO, Default), launch (fire-and-forget), async (returns result). Use for: network calls, database operations, any blocking work.
data class: automatic equals(), hashCode(), toString(), copy(), componentN() functions. Requirements: primary constructor with at least one parameter, all params must be val or var. copy() creates new instance with optional modified properties. Destructuring: val (name, age) = person. Use for: DTOs, domain models, any class primarily holding data.
Compose: declarative UI toolkit, Kotlin-based, reactive updates. Benefits: less code, no XML, preview support, easier state management. vs XML: Compose is functions, XML is markup; Compose recomposes on state change, XML requires manual updates. Migration: can mix Compose and XML. Use ComposeView in XML, AndroidView in Compose. Modern Android prefers Compose.
Practice with interactive quizzes and get instant feedback.
Start Free Practice