Skip to main content
InterviewHubPRO
HomeTracksSection 53: Android & Jetpack Compose (50 Qs)
Section 53 of 6450 Questions (1 Per Page)

Native Android, Jetpack Compose & Clean Architecture Master Interview Bank

Android Activity/Fragment Lifecycle, Jetpack Compose Recomposition & Stability, State Hoisting, Room, Hilt Dependency Injection, WorkManager, ART Internals, and Profiling.

Curriculum Roadmap & Learning Path

3 Stages
Tip: Click any stage card above to instantly filter the question bank to that topic.3 Connected Milestones
50 of 50 Qs

Part 1: Architecture, Jetpack Compose & Core Components (1 - 10)

10 Questions
1
SeniorCode#Components#Lifecycle

What is the Activity Lifecycle in Android and what are its core callback states?

An Activity represents a single focused screen that the user can interact with. Its lifecycle transitions through 6 core callbacks: onCreate(): Activity is initialized; setup UI views, data bindings, and ViewModel observers • onStart(): Activity becomes visible to the user, but not yet interactive.

2
SeniorCode#Components#Docker & Containers

What is Jetpack Compose and how does it differ from traditional XML-based Views?

Jetpack Compose is Android's modern declarative UI toolkit: Imperative XML Views (Legacy): UI declared in XML layout files; mutated imperatively in Kotlin/Java code by traversing the view hierarchy • Declarative Compose (Modern): UI is defined as Kotlin @Composable functions that describe what the UI should look like for a given state.

3
Senior#Components#Docker & Containers

What is an Intent in Android (Explicit vs Implicit)?

An Intent is an asynchronous messaging object used to request an action from another app component: Explicit Intent: Specifies the exact target component class name (e.g. launching an internal ProfileActivity from MainActivity).

4
Senior#Components#Docker & Containers

What is a ViewModel in Android Architecture Components and why does it survive configuration changes?

A ViewModel stores and manages UI-related data in a lifecycle-conscious way: Configuration Change Problem: Rotating the phone or switching to dark mode destroys and recreates the Activity • ViewModel Lifecycle: The ViewModel remains retained in memory in the ViewModelStore throughout the configuration change until the Activity is.

5
Senior#Components#Docker & Containers

What is the difference between `remember` and `rememberSaveable` in Compose?

remember { mutableStateOf(...) }: Preserves state across recompositions (when the composable function re-runs) • rememberSaveable { mutableStateOf(...) }: Preserves state across both recompositions AND configuration changes / process death by saving values.

6
Most AskedSeniorCode#Components#Closures & Scope

What is State Hoisting in Jetpack Compose?

State hoisting is a programming pattern of moving state up to a caller component to make a composable stateless: Replaces internal state with two parameters • value: T: The current value to display • onValueChange: (T) -> Unit: An event callback lambda requesting the value to change.

7
Senior#Components#Docker & Containers

What is the Android Manifest (`AndroidManifest.xml`)?

The root configuration file of every Android application: Declares the application package name, app icon, theme, and version • Declares all 4 core Android components: Activities, Services, Broadcast Receivers, and Content Providers.

8
Senior#Components#Docker & Containers

What are Android App Permissions (Install-time vs Runtime Permissions)?

Install-time Permissions (Normal): Automatically granted upon downloading from Google Play Store (e.g. INTERNET, ACCESSNETWORKSTATE) • Runtime Permissions (Dangerous): Involve user privacy or device control (e.g. CAMERA, ACCESSFINELOCATION, RECORD_AUDIO).

9
Senior#Components#Docker & Containers

What is Room Database in Android Jetpack?

Room is an abstraction layer over SQLite that provides robust database access: @Entity: Represents a table in the database • @Dao (Data Access Object): Defines SQL query methods with compile-time SQL verification • @Database: The database holder class that serves as the main access point.

10
SeniorCode#Components#Docker & Containers

What are Side-Effects in Jetpack Compose: `LaunchedEffect` vs `rememberCoroutineScope` vs `DisposableEffect`?

A Composable function should be pure and free of side-effects. Side-Effect handlers safely execute asynchronous tasks: LaunchedEffect(key): Launches a coroutine when the composable enters the composition.

Part 2: Compose Internals, Persistence, DI & Background Work (11 - 24)

14 Questions
11
Most AskedSeniorCode#Dependency Injection#Components

What is Dependency Injection with Hilt and what are the standard Component Scopes?

Hilt is Google's recommended dependency injection library for Android, built on top of Dagger: Eliminates manual boilerplate by generating Dagger components for Android lifecycles • @Singleton (SingletonComponent): Lives for the entire application lifetime.

12
Senior#Docker & Containers

How does Retrofit manage networking and JSON serialization on Android?

Retrofit is a type-safe HTTP client for Android and Kotlin: Translates an interface with HTTP annotations (@GET, @POST, @Path, @Query, @Body) into a live REST client • Uses OkHttp as the underlying HTTP engine (connection pooling, TLS 1.3, interceptors).

13
Senior#Docker & Containers#HTTP & REST APIs

What are OkHttp Interceptors (Application vs Network Interceptors)?

Interceptors inspect, modify, or retry outbound HTTP requests and inbound responses: Application Interceptor: Sits between application code and OkHttp • Network Interceptor: Sits between OkHttp and the physical network socket.

14
Senior#Docker & Containers

What is WorkManager and when should it be used over Coroutines?

WorkManager is the recommended solution for persistent, deferrable background work: Coroutines: Bound to app process memory • WorkManager: Persists task jobs to an internal SQLite database • Allows setting execution constraints: setRequiredNetworkType(NetworkType.UNMETERED) (only on Wi-Fi), setRequiresCharging(true).

15
Senior#Docker & Containers

What are Android Services (Foreground, Background, Bound)?

A Service is an application component that performs long-running operations in the background without a UI: Foreground Service: Performs operations noticeable to the user (e.g. music playback, GPS navigation, active file download).

16
Most AskedSenior#Docker & Containers

What is Scoped Storage in Android?

Introduced in Android 10+ to protect user privacy and eliminate wide access to external storage: Apps have an isolated, app-specific internal directory (context.filesDir) that other apps cannot view • Apps cannot access arbitrary file paths on external storage (/sdcard/).

17
Senior#Docker & Containers

What is ProGuard / R8 and how does it optimize Android APK/AAB size?

R8 is the default compiler and code shrinker for Android builds: Shrinking: Tree-shakes and strips unused classes, fields, and library methods • Optimization: Inlines functions, removes dead branches, and optimizes bytecode.

18
SeniorCode#Docker & Containers

How does Recomposition work internally in Jetpack Compose?

Recomposition is the process of re-running composable functions when state inputs change: Slot Table: Compose stores composable hierarchy and remembered state in an internal continuous in-memory array called a Slot Table • Positional Memoization: Compose identifies UI elements by their call-site execution position in the Slot Table.

19
Senior#Docker & Containers

What makes a Composable function "Skippable" and what are `@Stable` and `@Immutable`?

Compose skips recomposition only if all parameter types are Stable: Primitive types (Int, String), functional lambdas, and classes marked with @Immutable are considered stable • The Stability Trap: Standard Kotlin ListT is an interface; Compose treats it as unstable because a subclass could be mutable (ArrayList).

20
Senior#Memory Management#Docker & Containers

What are Memory Leaks on Android and how do you detect them using LeakCanary?

A memory leak occurs when an object that is no longer needed (e.g. an Activity destroyed on screen rotation) is retained in memory because an active object holds a strong reference to it: Common Causes: Static variables referencing Context, non-static inner classes, long-running coroutines holding Activity references...

21
Senior#Docker & Containers

What is the difference between APK and Android App Bundle (AAB)?

APK (Legacy): Fat binary containing all compiled DEX code, resources for all screen densities (hdpi, xhdpi, xxxhdpi), languages, and CPU • AAB (App Bundle - Required since 2021): Uploaded to Google Play Console.

22
SeniorCode#Docker & Containers#System Design

How do you implement Offline-First Architecture on Android?

The UI observes local persistent storage as the Single Source of Truth (SSOT): UI collects from a Room Database Flow • A Repository triggers an asynchronous network request in the background • Network response is written directly into the local Room database (INSERT OR REPLACE).

23
Senior#Docker & Containers

What is the ART (Android Runtime) and how does AOT and JIT Compilation work?

ART executes Dalvik bytecode (.dex files) on modern Android devices: Dalvik (Ancient): Pure JIT (Just-In-Time) compilation on every app launch; slow and battery intensive • Android 5.0 (Pure AOT): Ahead-Of-Time compilation during app install.

24
Senior#Docker & Containers#Data Structures

How does the Android Looper, Handler, and MessageQueue work under the hood?

The foundation of thread communication and the Android Main (UI) thread: MessageQueue: A low-level unbounded linked list of messages and runnables to be processed • Looper: An infinite loop running on a thread (Looper.loop()) that continuously polls the MessageQueue for work and dispatches messages.

Part 3: ART Internals, Memory Leak Profiling & Production Hardening (25 - 35)

26 Questions
25
Senior#Performance#Memory Management

What is App Startup Optimization and how does Jetpack App Startup work?

Many third-party libraries (Firebase, WorkManager, LeakCanary) automatically initialize themselves during app launch using hidden ContentProviders: Having 10 ContentProviders slows down Cold Start time significantly because each provider is initialized sequentially before Application.onCreate().

26
SeniorCode#Performance#Memory Management

How do you implement Custom Canvas drawing in Jetpack Compose?

When standard Compose layouts are insufficient, use the Canvas composable: Grants access to a DrawScope for hardware-accelerated 2D rendering.

27
Senior#Performance#Memory Management

How does Android handle Process Death and State Restoration?

When an app is in the background, Android OS can terminate the app process at any time to reclaim RAM for other apps: When the user navigates back, the system creates a brand new process and calls onCreate(savedInstanceState: Bundle?).

28
Senior#Performance#Memory Management

What is the difference between Cold Start, Warm Start, and Hot Start?

Cold Start (Slowest): App launches from scratch • Warm Start: App process is already in memory, but the Activity was destroyed and must be recreated (e.g. rotation, or returning after background.

29
Senior#Performance#Memory Management

What is Dynamic Feature Delivery with Play Feature Delivery?

Allows breaking an app into dynamic feature modules that are downloaded on demand rather than bundled in the initial install: Example: An AR Camera filter module (40 MB) is downloaded only when the user taps "Open AR Camera", saving initial download bandwidth • Modules can also be uninstalled programmatically to reclaim device storage.

30
Senior#Performance#Memory Management

How does Deep Linking work in Android (Deep Links vs Web Links vs Android App Links)?

Deep Links (Custom Scheme): e.g. myapp://profile/101 • Web Links (HTTP/HTTPS without verification): e.g. https://myapp.com/profile/101 • Android App Links (Verified HTTPS): Digital Asset Links JSON file (/.well-known/assetlinks.json) hosted on your web domain verifies app ownership.

31
Senior#Forms#Performance

How do you benchmark and profile UI performance using Macrobenchmark?

Traditional microbenchmarks test small code loops in isolation • Macrobenchmark: Runs on a real Android device/emulator, driving the app through end-to-end user journeys (scrolling a list, app cold start).

32
Senior#Performance#Memory Management

When should you build a Native Android app vs React Native or Flutter?

Build Native Android (Kotlin + Compose) • Apps requiring deep hardware integration (Bluetooth Low Energy, custom USB peripherals, camera camera2 API) • High-performance 3D graphics, real-time audio DSP, or complex background services (WorkManager, VPNs).

33
Senior#Performance#Memory Management

What is Baseline Profiles and how does it eliminate Android App Startup Jank?

Baseline Profiles are pre-compiled AOT rule files shipped inside APK/AABs. ART compiles critical user paths (app launch, scrolling lists) into native machine code during installation, eliminating JIT compilation pauses during initial execution.

34
Senior#Performance#Memory Management

How do you implement Biometric Authentication securely on Android with BiometricPrompt and Android Keystore?

Generate an asymmetric cryptographic key inside the hardware-backed Android Keystore requiring user authentication (setUserAuthenticationRequired(true)). Pass a CryptoObject to BiometricPrompt to authorize operations.

35
Senior#Performance#Memory Management

What are Foreground Services vs Background Execution limits in modern Android (Android 14+)?

Android strictly restricts background work to preserve battery. Foreground Services display an ongoing persistent notification and require declaring explicit foregroundServiceType (e.g., location, mediaPlayback, dataSync) in Android 14+.

36
Senior#Performance#Memory Management

Jetpack Compose Internals: The Slot Table, Composer, and Smart Recomposition.

Unlike traditional Android XML Views that exist as a heavy mutable hierarchy of View objects on the heap, Jetpack Compose represents UI as an in-memory flat data array called the Slot Table: Slot Table: A contiguous array (gap buffer) that stores the state and values emitted by @Composable functions during execution.

37
Senior#Performance#Memory Management

Jetpack Compose State Stability: `@Stable`, `@Immutable`, and Collections stability.

In Compose, a function can only be skipped during recomposition if all its parameters are proven to be Stable: Primitives & Strings: Automatically stable • The List Problem: Standard Kotlin ListT is an interface • Fixes • Use Kotlinx Immutable Collections (ImmutableListT).

38
Most AskedSenior#Dependency Injection#Components

Dependency Injection with Hilt / Dagger: Scopes, Component Lifecycles, and `@HiltViewModel`.

Hilt simplifies Dagger on Android by providing standard, pre-defined dependency scopes tied directly to Android OS component lifecycles: @Singleton: Survives the entire application lifetime (SingletonComponent) • @ActivityRetainedScoped: Survives configuration changes (screen rotations) alongside ViewModels.

39
SeniorCode#Components#Performance

Android Architecture Components: Room Persistence Library and Flow integration.

Room is an object-mapping abstraction over SQLite: Compile-Time SQL Verification: Validates SQL queries at compile time; if you mistype a column name, the build fails immediately instead of • Reactive Flow Integration.

40
Senior#Performance#Memory Management

Android ART vs Dalvik: AOT, JIT with Profile-Guided Optimization (PGO), and Cloud Profiles.

How Android executes compiled DEX bytecode: Dalvik (Legacy): Interpreted bytecode with basic Just-In-Time (JIT) compilation; high CPU overhead and slow app launch • ART AOT (Android 5.0): Compiled all bytecode into native machine code at install time • ART Modern Hybrid (PGO + Cloud Profiles) • Apps install quickly with JIT.

41
SeniorCode#Routing#Performance

Navigation in Jetpack Compose: Type-safe navigation routes and shared element transitions.

Modern Compose Navigation (Navigation 2.8+) replaces fragile string URLs ("profile/{id}") with strongly typed Kotlin Serializable classes.

42
Senior#Lifecycle#Performance

Coroutine Lifecycle in Android: `repeatOnLifecycle` vs `launchWhenStarted`.

Collecting flows naively on Android can cause catastrophic background leaks: launchWhenStarted (Deprecated & Dangerous): Pauses coroutine execution when the app enters the background, but keeps the active upstream Flow.

43
Senior#Performance#Memory Management

Network Layer with Retrofit, OkHttp, and Interceptors: Connection pooling and certificate pinning.

The gold standard Android networking stack: Connection Pooling: OkHttp keeps persistent HTTP/2 and HTTP/3 TCP sockets open, eliminating handshake latency for subsequent requests • Interceptors: Chain of middleware for logging, adding auth headers (Authorization: Bearer ), and handling token refresh automatically via.

44
Senior#Performance#Memory Management

WorkManager Deep Dive: Constraints, `PeriodicWorkRequest`, and Expedited Work.

WorkManager is Android's guaranteed background processing engine: Guaranteed Execution: Jobs persist in an internal SQLite database; if the device reboots or runs out of battery, WorkManager resumes the job.

45
Senior#Performance#Memory Management

Android IPC (Inter-Process Communication): Binder, AIDL, and Parcelable serialization.

In Android, each application runs in its own isolated Linux process: Binder: A Linux kernel driver (/dev/binder) optimized for fast inter-process communication using shared memory pages • Parcelable: High-performance, reflection-free Android binary serialization format designed specifically for Binder transaction buffers (capped.

46
Senior#Performance#Memory Management

Memory Leak Profiling: LeakCanary architecture and common Activity retain leaks.

A memory leak occurs when an object is no longer needed (e.g. an Activity destroyed after back press) but remains referenced by a GC Root, preventing garbage collection: Common Causes: Static variables holding Context references, non-static inner classes, un-cancelled RxJava/Coroutine subscriptions, or singleton.

47
Senior#Performance#Memory Management

Security & Encryption: Android Keystore, EncryptedSharedPreferences, and Play Integrity API.

Securing Android enterprise apps: Android Keystore: Cryptographic keys are generated and stored inside hardware security modules (TEE - Trusted Execution Environment / • EncryptedSharedPreferences: Automatically encrypts key-value preferences using AES-256 GCM.

48
Senior#Performance#Memory Management

Jetpack Glance: Building modern App Widgets with declarative Compose-like syntax.

Historically, Android Home Screen Widgets required complex, clunky XML RemoteViews: Jetpack Glance: Brings declarative Jetpack Compose paradigms to Android Widgets • Translates composable functions into RemoteViews hierarchies underneath, providing reactive state management and seamless Material You dynamic.

49
SeniorCode#Performance#Memory Management

Custom Views and Custom Modifiers in Compose: Layout phase and MeasurePolicy.

Building custom layout algorithms in Compose: Three Phases of Compose: Composition (What to show), Layout (Where to place), and Drawing (How to render) • Custom Layout Composable.

50
SeniorCode#Performance#Memory Management

Edge-to-Edge and Insets Handling in Modern Android (Android 15+).

In Android 15, apps are drawn Edge-to-Edge by default, displaying content directly behind the transparent system status bar and gesture navigation bar: WindowInsets Handling: Use Compose modifiers to prevent text from colliding with system navigation bars or camera punch-holes.