Junior Mobile Developer (Android) Interview Questions: Complete Guide

Milad Bonakdar
Author
Master Android development fundamentals with essential interview questions covering Kotlin, Activities, Fragments, Jetpack Compose, data persistence, and Android best practices for junior developers.
Introduction
Android development powers billions of devices worldwide, making it one of the most important mobile platforms. With Kotlin as the preferred language and modern tools like Jetpack Compose, Android developers create rich, performant applications for diverse users.
This guide covers essential interview questions for Junior Android Developers. We explore Kotlin fundamentals, Android components, UI development, data persistence, networking, and best practices to help you prepare for your first Android developer role.
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.
- Declarative: Describe what the UI should look like, not how to build it
- Benefits: Less code, intuitive, powerful, accelerates development
- Composable Functions: Building blocks of Compose UI
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:
Use libraries like Retrofit or OkHttp for networking. Avoid using HttpURLConnection directly.
Rarity: Very Common Difficulty: Medium
17. What is Room and how do you use it?
Answer: Room is an abstraction layer over SQLite for easier database access.
- Components:
- Entity: Represents a table
- DAO (Data Access Object): Defines database operations
- Database: Database holder
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 provide a way to write asynchronous code sequentially, making it easier to read and maintain.
- Benefits: Lightweight, structured concurrency, exception handling
- 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
Rarity: Very Common Difficulty: Medium



