Interview Android Questions
SECTION 1: Junior Android Developer (Q1–Q30)
Q1. What is Android?
Android is an open-source, Linux-based operating system developed by Google, primarily for mobile devices such as smartphones, tablets, TVs, and wearables. It provides a complete software stack, including an operating system, middleware, and key applications.
From a developer’s perspective, Android offers a rich application framework that allows apps to interact with device hardware, system services, and user interfaces in a secure and standardized way. Each Android application runs inside its own sandboxed process, ensuring isolation and system stability.
This design allows Android to scale across millions of devices with varying hardware configurations while maintaining security and performance.
Q2. Explain Android architecture in detail.
Android follows a layered architecture, where each layer has a specific responsibility and communicates with adjacent layers through well-defined interfaces.
At the base is the Linux Kernel, which handles memory management, process scheduling, power management, networking, and device drivers. Above it lies the Hardware Abstraction Layer (HAL), which allows the Android framework to interact with hardware without being tightly coupled to vendor-specific implementations.
The Native Libraries layer includes core C/C++ libraries such as SQLite and OpenGL. The Android Runtime (ART) executes application bytecode using a mix of ahead-of-time and just-in-time compilation. Above this, the Application Framework exposes high-level APIs used by developers. Finally, the Applications layer contains system and user apps.
This architecture ensures modularity, portability, and long-term maintainability.
Q3. What are Android application components?
Android applications are built using four primary component types, each designed for a specific role.
An Activity represents a single screen with which the user interacts. A Service performs long-running operations in the background without user interaction. A Broadcast Receiver listens for and responds to system-wide or application-specific events, such as connectivity changes. A Content Provider manages shared application data and allows secure access to it across applications.
These components are loosely coupled and communicate using Intents, enabling flexible app design and system-level integration.
Q4. What is an Activity?
An Activity is a core Android component that provides a user interface screen. It is responsible for displaying UI elements, handling user input, and coordinating with other components.
Activities are lifecycle-aware and can be paused, stopped, destroyed, and recreated by the system depending on memory conditions and user actions. Because of this, Activities should remain lightweight and avoid holding long-lived resources directly.
In modern Android development, Activities primarily act as UI containers, delegating business logic to ViewModels.
Q5. Explain the Activity lifecycle.
The Activity lifecycle defines how Android manages the creation, usage, and destruction of UI screens. Key lifecycle methods include onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy().
Each callback represents a transition in the Activity’s visibility or interaction state. Developers must use these callbacks to initialize resources, save state, release memory, and stop background work appropriately.
Proper lifecycle handling prevents memory leaks, UI freezes, and data loss—making it one of the most important Android concepts to master.
Q6. What is an Intent?
An Intent is a messaging object used to request an action from another Android component. It can be used to start Activities, start or bind Services, or send Broadcasts.
Intents can carry additional data and define actions, categories, and data types. This mechanism enables component decoupling and allows Android applications to interact seamlessly with one another.
Q7. Difference between explicit and implicit intents?
An explicit intent directly specifies the target component, making it suitable for internal app navigation. An implicit intent describes an action without specifying the component, allowing the system to determine the most appropriate app to handle it.
Implicit intents are fundamental to Android’s inter-app communication model, enabling features like sharing content or opening web links.
Q8. What is a Fragment?
A Fragment is a modular section of an Activity’s UI that has its own lifecycle. Fragments allow developers to create reusable and adaptable UI components that work across different screen sizes and orientations.
Fragments are especially important for building tablet, foldable, and multi-pane layouts. They promote UI modularity and cleaner Activity design.
Q9. What is AndroidManifest.xml?
The Android Manifest is a mandatory configuration file that describes essential information about the app to the Android system. It declares application components, permissions, required hardware features, and metadata.
Without a properly defined manifest, Android cannot install, launch, or grant permissions to the application.
Q10. What is Context?
Context represents the current state of the application environment. It provides access to system services, resources, databases, and preferences.
There are different types of Contexts (Activity Context, Application Context), and using the wrong one—especially holding references to Activity Context beyond its lifecycle—can cause memory leaks.
Q11. Difference between dp and sp?
dp (density-independent pixels) is used for defining layout dimensions to ensure consistent UI across devices with different screen densities.
sp (scale-independent pixels) is used for text sizes and respects user accessibility settings, such as font scaling.
Using the correct unit ensures both visual consistency and accessibility.
Q12. What is a Service?
A Service is an Android component designed to perform long-running operations without a user interface.
Services can run in the background, operate in the foreground with a persistent notification, or allow other components to bind and interact with them. Proper usage ensures smooth background processing without blocking the UI.
Q13. What is a Broadcast Receiver?
Broadcast Receivers allow apps to respond to system-wide or application-specific events, such as battery level changes or incoming messages.
They are designed to be lightweight and short-lived. Performing heavy operations inside a Broadcast Receiver can lead to performance issues or ANRs.
Q14. What is a Content Provider?
Content Providers manage structured data and provide a standardized interface for sharing data between applications.
They enforce permissions and ensure secure access, making them ideal for exposing data such as contacts or media files.
Q15. What is RecyclerView?
RecyclerView is a powerful UI component for displaying large or dynamic datasets efficiently.
It reuses item views through a recycling mechanism, minimizing memory usage and improving scrolling performance. RecyclerView is highly customizable through LayoutManagers and Adapters.
Q16. What is the ViewHolder pattern?
The ViewHolder pattern stores references to child views within a list item layout, avoiding repeated and expensive findViewById() calls.
This pattern significantly improves UI performance, especially in scrolling lists.
Q17. What is LayoutInflater?
LayoutInflater converts XML layout files into View objects at runtime.
It plays a crucial role in dynamically creating UI components, especially in adapters and fragments.
Q18. Toast vs Snackbar?
Toast displays a simple, short-lived message that does not interact with the UI. Snackbar, on the other hand, is more flexible, supports user actions, and integrates better with modern layouts.
Snackbar is generally preferred in modern Android apps.
Q19. What is APK?
APK (Android Package Kit) is the file format used to distribute Android applications. It contains compiled code, resources, assets, and metadata required for installation.
Q20. What is Android App Bundle (AAB)?
AAB is a publishing format that allows Google Play to generate optimized APKs for different device configurations, reducing app download size and improving delivery efficiency.
Q21. What is ViewBinding?
ViewBinding generates type-safe references to views, eliminating the need for manual view lookups and reducing runtime errors.
Q22. What is DataBinding?
DataBinding allows UI components to bind directly to data sources, enabling declarative UI updates and reducing boilerplate code.
Q23. What is ANR?
ANR (Application Not Responding) occurs when the main thread is blocked for too long, causing the UI to freeze.
Avoiding long operations on the UI thread is critical to preventing ANRs.
Q24. What is Logcat?
Logcat displays system and application logs, providing essential information for debugging and performance analysis.
Q25. What is Gradle?
Gradle is the build automation tool used by Android to compile code, manage dependencies, and package applications.
Q26. What is minSdkVersion?
It defines the minimum Android OS version required to install and run the app.
Q27. What is targetSdkVersion?
It indicates the Android version the app is optimized for, influencing system behavior and compatibility features.
Q28. What is the permissions system?
Android permissions protect user data and system resources by controlling access to sensitive APIs through install-time and runtime permissions.
Q29. What is ConstraintLayout?
ConstraintLayout allows developers to create flexible, flat UI hierarchies, improving performance and responsiveness.
Q30. Why is Android considered secure?
Android uses sandboxing, permissions, application signing, and SELinux enforcement to ensure robust security.
SECTION 2: Senior Android Developer (Q31–Q65)
Q31. What is MVVM architecture in Android?
MVVM (Model–View–ViewModel) is an architectural pattern that separates UI logic from business logic. The View (Activity/Fragment) handles rendering and user interaction, the ViewModel manages UI-related data and logic, and the Model represents data sources such as APIs or databases.
This separation improves testability, maintainability, and lifecycle awareness, as ViewModels survive configuration changes and prevent UI data loss.
Q32. Why is ViewModel lifecycle-aware?
ViewModel is designed to survive configuration changes like screen rotation. It is retained as long as the UI scope (Activity or Fragment) exists and is cleared only when the scope is permanently destroyed.
This prevents unnecessary data reloads and ensures that UI state remains consistent across lifecycle events.
Q33. What is LiveData and why is it used?
LiveData is an observable data holder class that is lifecycle-aware. It ensures that UI components only receive updates when they are in an active lifecycle state.
This avoids memory leaks, crashes, and redundant UI updates, making LiveData ideal for observing data in Activities and Fragments.
Q34. Difference between LiveData and Kotlin Flow?
LiveData is lifecycle-aware by default and tightly coupled with Android UI components. Kotlin Flow, on the other hand, is part of coroutines and represents a cold asynchronous data stream.
Flow offers more flexibility, supports backpressure, and is better suited for complex data pipelines. Modern Android development increasingly favors Flow.
Q35. What is the Repository pattern?
The Repository pattern abstracts data sources and provides a clean API to the ViewModel. It decides whether data should come from the network, database, or cache.
This pattern promotes single source of truth, simplifies testing, and enables offline-first architectures.
Q36. What is Android Jetpack?
Android Jetpack is a collection of libraries and tools that help developers follow best practices. It reduces boilerplate code and simplifies handling lifecycles, navigation, background work, and data persistence.
Jetpack encourages modern Android architecture and improves app stability.
Q37. What is Room and why is it preferred over SQLite?
Room is an abstraction layer over SQLite that provides compile-time query validation, type safety, and integration with LiveData and Flow.
It reduces runtime crashes caused by invalid SQL queries and simplifies database access in large applications.
Q38. What is WorkManager?
WorkManager is used for deferrable but guaranteed background work. It ensures tasks are executed even if the app exits or the device restarts.
It intelligently chooses the appropriate execution method based on system conditions and constraints.
Q39. Explain Android threading model.
Android follows a single-threaded UI model, meaning all UI updates must occur on the main thread. Blocking this thread causes UI freezes and ANRs.
Long-running operations such as network or database access must be offloaded to background threads or coroutines.
Q40. What are Kotlin Coroutines?
Coroutines provide a lightweight and structured way to perform asynchronous operations. They simplify async code by allowing developers to write sequential-looking code for concurrent tasks.
They integrate seamlessly with Android lifecycles and improve readability and error handling.
Q41. What is Dispatcher in Coroutines?
Dispatchers determine which thread a coroutine runs on. For example, Dispatchers.Main is used for UI operations, while Dispatchers.IO is used for network or disk tasks.
Choosing the correct dispatcher ensures optimal performance and thread safety.
Q42. What is a memory leak in Android?
A memory leak occurs when objects that are no longer needed remain referenced, preventing garbage collection. This leads to increased memory usage and potential app crashes.
Memory leaks often arise from improper lifecycle handling or static references.
Q43. Common causes of memory leaks?
Common causes include holding Activity context in static variables, failing to unregister listeners, and running long-lived background tasks tied to destroyed UI components.
Proper lifecycle awareness is key to avoiding leaks.
Q44. What is LeakCanary?
LeakCanary is a memory leak detection library that automatically identifies retained objects and provides detailed leak traces during development.
It helps developers catch leaks early before they impact production users.
Q45. What is ProGuard / R8?
ProGuard and R8 are tools that shrink, optimize, and obfuscate code. They reduce APK size, improve performance, and make reverse engineering more difficult.
R8 is the modern replacement for ProGuard and is integrated into the Android build process.
Q46. What is overdraw?
Overdraw occurs when the same pixel is drawn multiple times in a single frame. Excessive overdraw wastes GPU resources and causes rendering performance issues.
Reducing view hierarchy depth helps minimize overdraw.
Q47. How do you optimize RecyclerView performance?
RecyclerView can be optimized using DiffUtil for efficient updates, stable IDs, view recycling, and minimizing layout complexity.
These techniques improve scrolling smoothness and reduce CPU usage.
Q48. What is Paging library?
The Paging library loads data incrementally as the user scrolls. It reduces memory usage and improves performance when handling large datasets.
It integrates well with Room, Retrofit, and Flow.
Q49. What is Navigation Component?
Navigation Component simplifies in-app navigation by managing fragment transactions, back stack, and deep links in a safe and consistent way.
It reduces navigation-related bugs and boilerplate code.
Q50. What is ViewModelScope?
ViewModelScope is a coroutine scope tied to the ViewModel lifecycle. It ensures that background work is automatically cancelled when the ViewModel is cleared.
This prevents memory leaks and wasted computation.
Q51. What is StateFlow?
StateFlow is a hot data stream that always holds the latest value. It is ideal for representing UI state in modern Android apps.
Q52. What is SharedFlow?
SharedFlow is used for one-time events such as navigation or toast messages. Unlike StateFlow, it does not require an initial value.
Q53. What is Dependency Injection (DI)?
DI is a design pattern where dependencies are provided externally rather than created inside classes. This improves testability and decouples components.
Q54. Hilt vs Dagger?
Hilt is a higher-level abstraction over Dagger that simplifies dependency injection setup by providing predefined components and annotations.
Q55. What is Espresso?
Espresso is a UI testing framework that allows developers to write reliable and fast UI tests synchronized with the UI thread.
Q56. What is Robolectric?
Robolectric enables running Android tests on the JVM without an emulator, making tests faster and easier to integrate into CI pipelines.
Q57. What is the Android testing pyramid?
The testing pyramid emphasizes having more unit tests, fewer integration tests, and minimal UI tests to balance speed and reliability.
Q58. What is Retrofit?
Retrofit is a type-safe HTTP client that simplifies API communication by converting REST endpoints into Kotlin or Java interfaces.
Q59. What is OkHttp?
OkHttp handles low-level HTTP operations, including connection pooling, caching, retries, and interceptors.
Q60. Parcelable vs Serializable?
Parcelable is optimized for Android IPC and is significantly faster than Serializable, which relies on reflection.
Q61. What is StrictMode?
StrictMode detects bad practices such as disk or network access on the main thread during development.
Q62. What is caching in Android?
Caching stores frequently accessed data locally to improve performance, reduce network usage, and enable offline functionality.
Q63. What is API rate limiting?
API rate limiting restricts the number of requests to prevent server overload and ensure fair usage.
Q64. What is ViewStub?
ViewStub is a lightweight placeholder that inflates views only when needed, reducing initial layout cost.
Q65. Why is backward compatibility important?
Android runs on many OS versions. Backward compatibility ensures consistent behavior across devices and user bases.
SECTION 3: Principal Android Developer (Q66–Q100)
Q66. What is Clean Architecture in Android?
Clean Architecture is an architectural philosophy that enforces separation of concerns by dividing the application into distinct layers—typically UI, Domain, and Data. The core principle is that business logic must not depend on frameworks, UI, or external systems.
In Android, this means that use cases and domain models should remain independent of Activities, Fragments, Retrofit, Room, or Android SDK classes. Dependencies always point inward toward the domain layer.
At the Principal level, Clean Architecture is valued because it extends application lifespan, reduces refactoring cost, and allows teams to evolve UI frameworks (e.g., View → Compose) without rewriting core logic.
Q67. Why is modularization critical for large Android apps?
Modularization involves splitting a monolithic app into independent, well-defined modules. This is essential for large codebases where multiple teams work simultaneously.
From a technical perspective, modularization:
Improves build times via parallel compilation
Reduces cognitive load
Enforces architectural boundaries
From a leadership perspective, it enables team autonomy, safer refactoring, and clearer ownership. Principal developers often define module boundaries aligned with business domains, not technical layers alone.
Q68. Feature module vs library module – when to use each?
A library module contains reusable code (UI components, utilities, domain logic) and is typically included at compile time.
A feature module, especially a dynamic feature module, represents a user-facing feature that can be delivered on demand via Google Play. Feature modules reduce initial install size and support scalable product growth.
At scale, Principal engineers decide which features justify dynamic delivery based on usage patterns, size, and business priority.
Q69. How do you optimize Android app startup time at scale?
Startup optimization begins by identifying what truly must run at launch. Principals enforce lazy initialization, deferring analytics, logging, and non-critical SDK setup.
Advanced strategies include:
Baseline Profiles
Reducing dependency graph complexity
Avoiding heavy work in
Application.onCreate()Optimizing layout inflation
Startup time directly affects user retention and Play Store rankings, making it a strategic concern, not just a technical one.
Q70. What are Baseline Profiles and why do they matter?
Baseline Profiles guide Android Runtime (ART) on which code paths to precompile ahead of time. This significantly reduces cold start and frame rendering latency.
At scale, Principals treat Baseline Profiles as a performance contract—updated regularly as user journeys evolve. They are especially important for apps with complex navigation or heavy dependency graphs.
Q71. How do you handle backward compatibility across Android versions?
Backward compatibility is addressed through AndroidX, runtime feature checks, and graceful degradation. Instead of branching logic everywhere, Principals enforce compatibility abstractions at architectural boundaries.
Strategically, backward compatibility decisions are tied to user demographics, device analytics, and business ROI—not just technical feasibility.
Q72. How do you secure sensitive user data in Android applications?
Security begins with minimizing data exposure. Sensitive information should be encrypted at rest using Android Keystore-backed encryption and protected in transit using TLS with modern cipher suites.
Principals also consider:
Threat modeling
API misuse prevention
Root and tamper detection
Secure key rotation
Security is treated as a continuous process, not a one-time implementation.
Q73. What is certificate pinning and when should it be used?
Certificate pinning restricts an app to trust only specific server certificates or public keys. This prevents man-in-the-middle attacks, even if a malicious certificate authority is compromised.
At Principal level, pinning is applied selectively—usually for high-risk applications (finance, healthcare)—because it increases operational complexity during certificate rotation.
Q74. How do you protect Android apps from reverse engineering?
Complete prevention is impossible, but resistance can be increased through code obfuscation, string encryption, runtime integrity checks, and server-side validation.
Principals balance security with maintainability, ensuring protections do not hinder debugging, CI/CD pipelines, or legitimate user access.
Q75. What is offline-first architecture and why is it important?
Offline-first architecture treats the local database as the primary source of truth, synchronizing with the server when connectivity is available.
This approach improves:
User experience
Reliability in poor networks
Perceived performance
At scale, offline-first design reduces backend load and aligns with global user bases where connectivity is inconsistent.
Q76. How do you design Android apps to scale to millions of users?
Scaling requires both client-side efficiency and backend awareness. On Android, this means optimized networking, caching strategies, pagination, and strict performance budgets.
Principals also ensure observability, feature flagging, and controlled rollouts to safely introduce changes without destabilizing the user base.
Q77. How do you monitor performance in production?
Production monitoring combines:
Android Profiler insights
Play Console metrics
Crash analytics
Real-user performance monitoring
Principals track trends over time rather than isolated metrics, using data to guide architectural improvements and prioritization.
Q78. How do you manage technical debt in Android projects?
Technical debt is inevitable. Principals manage it deliberately through scheduled refactoring, architectural reviews, and enforcing coding standards.
Debt is documented, prioritized, and paid down incrementally—never ignored or allowed to silently accumulate.
Q79. What is observability and why does it matter?
Observability is the ability to understand system behavior using logs, metrics, and traces. It allows teams to diagnose issues without reproducing them locally.
At scale, observability enables faster incident response, better decision-making, and long-term system reliability.
Q80. How do you design fault-tolerant Android apps?
Fault tolerance involves graceful handling of failures—network timeouts, partial data, API errors, or corrupted state.
Principals enforce retry policies, fallback UI states, and robust error reporting so failures degrade functionality gracefully rather than catastrophically.
Q81. How do you lead large Android teams effectively?
Leadership focuses on clarity and enablement, not micromanagement. Principals establish architectural guidelines, code review standards, and shared ownership models.
They also mentor senior engineers, align teams with product goals, and reduce friction through tooling and documentation.
Q82. What is dependency inversion and why is it critical?
Dependency inversion ensures that high-level modules depend on abstractions, not concrete implementations.
This principle allows systems to evolve without cascading changes and is foundational for testability and modular architecture.
Q83. How do you evaluate new Android APIs and libraries?
Evaluation considers API stability, backward compatibility, maintenance risk, community adoption, and long-term alignment with platform direction.
Principals avoid premature adoption while ensuring the team does not lag behind critical platform advancements.
Q84. How do you design reusable UI components at scale?
Reusable components are built using composition over inheritance, consistent theming, and well-defined state inputs.
At scale, Principals often define design systems to ensure visual and behavioral consistency across features and teams.
Q85. What is unidirectional data flow and why is it preferred?
Unidirectional data flow ensures state changes occur in a single, predictable direction—input → state → UI.
This reduces bugs, simplifies debugging, and scales well as applications grow in complexity.
Q86. What is Jetpack Compose and why is it transformative?
Jetpack Compose is a declarative UI toolkit that allows developers to describe UI as a function of state.
It reduces boilerplate, improves readability, and integrates naturally with unidirectional data flow, making UI code more predictable and testable.
Q87. Compose vs View system – architectural impact?
Compose shifts UI development from imperative updates to declarative state-driven rendering.
Principals view Compose as an architectural evolution that aligns UI more closely with modern reactive patterns.
Q88. How do you migrate legacy Android apps safely?
Migration is incremental—feature by feature—using parallel architectures, feature flags, and automated tests.
Principals avoid “big bang” rewrites, focusing instead on controlled, measurable progress.
Q89. How do you ensure accessibility in Android apps?
Accessibility is ensured through semantic UI labels, scalable text, proper contrast, and testing with accessibility tools.
At leadership level, accessibility is treated as a product requirement, not an afterthought.
Q90. What is internationalization (i18n) and why is it complex?
Internationalization involves supporting multiple languages, locales, currencies, and cultural formats.
Principals design systems that handle layout expansion, RTL languages, and regional compliance gracefully.
Q91. How do you manage app versioning and releases?
Principals define versioning strategies aligned with CI/CD pipelines, rollback mechanisms, and staged rollouts.
Versioning becomes a risk management tool, not just a numbering scheme.
Q92. What defines a Principal Android Developer?
A Principal Android Developer owns technical vision, influences architecture across teams, mentors engineers, and aligns engineering decisions with business outcomes.
They operate beyond feature implementation, focusing on long-term system health.
Q93. How do you align Android engineering with business goals?
Alignment is achieved by translating business requirements into scalable technical solutions while balancing performance, quality, and delivery speed.
Principals act as technical translators between product, design, and engineering.
Q94. How do you measure Android engineering success?
Success is measured through stability metrics, performance benchmarks, delivery predictability, and user satisfaction—not just feature count.
Q95. What ensures long-term maintainability of Android apps?
Maintainability comes from clean architecture, modularization, testing discipline, and documentation.
Principals optimize for future engineers, not just current requirements.
Q96. How do you future-proof Android applications?
Future-proofing involves minimizing coupling, adopting standards, and monitoring platform evolution proactively.
Q97. What is technical leadership in Android development?
Technical leadership is about guiding decisions, setting standards, and enabling teams to deliver consistently high-quality software.
Q98. How do you handle critical production incidents?
Principals lead root-cause analysis, coordinate cross-functional response, and implement preventive measures—not just fixes.
Q99. How do you mentor junior and senior developers?
Mentorship involves code reviews, architectural discussions, pairing sessions, and constructive feedback tailored to experience level.
Q100. What is the biggest challenge in modern Android development?
Balancing rapid platform evolution, device fragmentation, performance expectations, and security requirements—while delivering business value.