Junior Android Developer Interview Questions and Answers

Milad Bonakdar
Author
Prepare for a junior Android developer interview with focused Kotlin, lifecycle, Jetpack Compose, Room, networking, and coroutine questions.
Introduction
For a junior Android developer interview, expect questions that test whether you can explain Kotlin basics, Android component lifecycles, Compose state, local storage, networking, and coroutines in practical terms. Strong answers connect each concept to how you would build a small, reliable app: keep UI state in the right place, avoid blocking the main thread, persist data safely, and handle errors clearly.
Use this guide to rehearse concise answers, then pair each topic with a small project example from your resume or portfolio. If you built a task app, weather app, or API-backed screen, map the answers below to that work so your interview sounds specific rather than memorized.
Kotlin Fundamentals (6 Questions)
1. What is the difference between val and var in Kotlin?
Answer:
val: Declares an immutable (read-only) variable. Once assigned, its value cannot be changed.var: Declares a mutable variable. Its value can be changed after initialization.- Best Practice: Use
valby default for safety. Only usevarwhen you need to reassign the value.
Rarity: Very Common Difficulty: Easy
2. Explain Nullable types and the Safe Call operator in Kotlin.
Answer: Kotlin's type system distinguishes between nullable and non-nullable types to prevent null pointer exceptions.
- Nullable Type: Add
?after the type:String? - Safe Call (
?.): Calls a method only if the object is not null - Elvis Operator (
?:): Provides a default value if null - Not-null Assertion (
!!): Throws exception if null (use sparingly)
Rarity: Very Common Difficulty: Easy
3. What is the difference between a class and a data class in Kotlin?
Answer:
- Regular Class: Standard class definition
- Data Class: Automatically generates useful methods for holding data
equals()andhashCode()toString()copy()functioncomponentN()functions for destructuring
Rarity: Very Common Difficulty: Easy
4. What are Lambda expressions and Higher-order functions in Kotlin?
Answer:
- Lambda: Anonymous function that can be passed as a value
- Higher-order Function: Function that takes functions as parameters or returns a function
Rarity: Very Common Difficulty: Medium
5. Explain Extension Functions in Kotlin.
Answer: Extension functions allow you to add new functions to existing classes without modifying their source code.
Rarity: Common Difficulty: Easy
6. What is the difference between == and === in Kotlin?
Answer:
==: Structural equality (compares values usingequals())===: Referential equality (compares memory references)
Rarity: Common Difficulty: Easy
Android Components (5 Questions)
7. What is an Activity and explain its lifecycle.
Answer: An Activity represents a single screen with a user interface. It has a well-defined lifecycle:
onCreate(): Activity is created. Initialize UI, set content view.onStart(): Activity becomes visible.onResume(): Activity is in foreground and interactive.onPause(): Activity losing focus (another activity coming to foreground).onStop(): Activity no longer visible.onDestroy(): Activity is destroyed.
Rarity: Very Common Difficulty: Easy
8. What is the difference between an Activity and a Fragment?
Answer:
- Activity: Represents a full screen. Entry point for user interaction. Has its own lifecycle.
- Fragment: Reusable portion of UI within an Activity. Multiple fragments can exist in one activity. Has its own lifecycle tied to the host activity.
- Benefits of Fragments:
- Reusability across activities
- Modular UI components
- Support for tablets (multi-pane layouts)
- Navigation component integration
Rarity: Very Common Difficulty: Easy
9. What is an Intent and what are its types?
Answer: Intent is a messaging object used to request an action from another app component.
- Explicit Intent: Specifies the exact component to start (by class name)
- Implicit Intent: Declares a general action, and the system finds the appropriate component
Rarity: Very Common Difficulty: Easy
10. What is a Service in Android?
Answer: A Service is a component that runs in the background to perform long-running operations without a user interface.
- Types:
- Foreground Service: Performs noticeable operations (music player). Shows notification.
- Background Service: Performs operations not directly noticed by user.
- Bound Service: Allows components to bind to it and interact.
Rarity: Common Difficulty: Medium
11. What is a BroadcastReceiver?
Answer: BroadcastReceiver is a component that responds to system-wide broadcast announcements.
- Use Cases: Battery low, network connectivity changes, SMS received, boot completed
- Registration:
- Static: In AndroidManifest.xml (limited in newer Android versions)
- Dynamic: In code (preferred)
Rarity: Common Difficulty: Easy
UI Development (4 Questions)
12. What is the difference between LinearLayout, RelativeLayout, and ConstraintLayout?
Answer:
- LinearLayout: Arranges children in a single row or column. Simple but can lead to nested layouts.
- RelativeLayout: Positions children relative to each other or parent. More flexible but complex.
- ConstraintLayout: Modern, flexible layout. Flat view hierarchy. Recommended for complex UIs.
Rarity: Very Common Difficulty: Easy
13. What is RecyclerView and how does it work?
Answer: RecyclerView is an efficient widget for displaying large lists by recycling views.
- Components:
- Adapter: Binds data to views
- ViewHolder: Holds references to views (avoids
findViewByIdcalls) - LayoutManager: Positions items (Linear, Grid, Staggered)
Rarity: Very Common Difficulty: Medium
14. What is Jetpack Compose?
Answer: Jetpack Compose is Android's modern declarative UI toolkit, built for Kotlin. Instead of updating views manually, you describe the UI for the current state and Compose redraws the affected parts when state changes.
- Composable functions: Kotlin functions annotated with
@Composablethat describe UI. - State: Values such as text input, loading state, or selected items that drive what appears on screen.
- State hoisting: Move state up to a parent or ViewModel when multiple composables need it.
- Interview cue: Mention
rememberfor local UI state,rememberSaveablefor simple state that should survive configuration changes, and ViewModel for screen-level state.
Rarity: Very Common Difficulty: Easy
15. What is the difference between match_parent and wrap_content?
Answer: These are layout parameters that define view dimensions:
match_parent: View expands to fill the parent's sizewrap_content: View sizes itself to fit its content- Fixed Size: Specific dp value (e.g.,
100dp)
Rarity: Very Common Difficulty: Easy
Data & Networking (5 Questions)
16. How do you make a network request in Android?
Answer: In a modern Android app, network calls usually live behind a repository and run from a ViewModel or use case with coroutines. Retrofit or OkHttp are common choices. A junior-level answer should also mention loading, success, empty, and error states so the UI does not freeze or fail silently.
Rarity: Very Common Difficulty: Medium
17. What is Room and how do you use it?
Answer: Room is Android's persistence library that provides an abstraction layer over SQLite. It is useful when the app needs structured local data, offline support, caching, or relational queries. In an interview, make it clear that database work should not run on the main thread.
- Components:
- Entity: Represents a table
- DAO (Data Access Object): Defines database operations
- Database: Database holder
- Practical example: Cache API results in Room, display cached data immediately, then refresh from the network when available.
Rarity: Very Common Difficulty: Medium
18. What is SharedPreferences?
Answer: SharedPreferences stores small amounts of primitive data as key-value pairs.
- Use Cases: User settings, preferences, simple flags
- Not for: Large data, complex objects (use Room instead)
Rarity: Very Common Difficulty: Easy
19. What is the difference between apply() and commit() in SharedPreferences?
Answer: Both save changes to SharedPreferences, but differ in behavior:
apply(): Asynchronous. Returns immediately. Changes written to disk in background. No return value.commit(): Synchronous. Blocks until changes are written. Returns boolean (success/failure).- Best Practice: Use
apply()unless you need the return value.
Rarity: Common Difficulty: Easy
20. What is Coroutines in Kotlin?
Answer: Coroutines let you write asynchronous code in a sequential style. In Android interviews, connect them to practical work: network calls, database operations, timers, and background tasks that should not block the main thread.
- Benefits: Lightweight concurrency, structured cancellation, readable async code
- Key Concepts:
suspend: Function that can be paused and resumedlaunch: Starts a coroutine (fire and forget)async: Starts a coroutine and returns a result- Dispatchers: Control which thread the coroutine runs on
viewModelScope: Cancels work automatically when the ViewModel is cleared
Rarity: Very Common Difficulty: Medium


