Posted in

Top 30 Android Interview Questions and Answers for All Experience Levels

Basic Android Interview Questions

These foundational questions are ideal for freshers and those new to Android development. They cover core concepts and components.

1. What is Android?

Android is an open-source operating system based on the Linux kernel, designed primarily for mobile devices like smartphones and tablets.[3]

2. What are the main components of an Android application?

The four main components are Activities, Services, Broadcast Receivers, and Content Providers.[1][3]

3. What is AndroidManifest.xml?

AndroidManifest.xml is a configuration file that declares the application’s components, permissions, hardware requirements, and metadata like icons and themes.[1][3]

4. What is the Application class in Android?

The Application class is a base class for maintaining global application state. It is instantiated when the app process starts and remains until the process ends.[1][6]

5. What is Context in Android?

Context provides access to application-specific resources and classes. It is used for database operations, starting activities, and accessing assets.[1][3][6]

6. What is an Activity?

An Activity represents a single screen with a user interface. It handles user interactions and lifecycle events.[3][6]

7. Explain the Activity lifecycle methods.

Key methods include onCreate(), onStart(), onResume(), onPause(), onStop(), onRestart(), and onDestroy(). onCreate() initializes the activity, onResume() makes it interactive, and onDestroy() releases resources.[3][6]

8. What is the difference between targetSdkVersion and compileSdkVersion?

compileSdkVersion is the version of the Android SDK used to compile the app. targetSdkVersion indicates the API level the app is tested on, affecting runtime behavior.[2]

9. What are Intents?

Intents are messaging objects used to request actions from other app components, either within the app (explicit) or across apps (implicit).[4]

10. What is a Fragment?

A Fragment is a modular UI component that represents a portion of an Activity’s behavior. It can be reused across activities and supports its own lifecycle.[4]

Intermediate Android Interview Questions

These questions target developers with 1-3 years of experience, focusing on practical implementation and optimization.

11. What are Services in Android?

Services perform long-running operations in the background without a UI. Types include Started Services and Bound Services.[6]

12. Differentiate between started and bound services.

Started services run independently until stopped. Bound services allow clients to bind and communicate via IPC.[6]

13. What is Doze mode?

Doze is a power-saving mode that restricts app activity when the device is idle and screen off to optimize battery life.[1]

14. How do you support different screen sizes?

Use dp units, sp for text, qualifiers like sw (smallest width), and constraint layouts for responsive designs.[1]

15. What are permissions in Android?

Permissions control access to sensitive features like camera or location. They have protection levels: normal, dangerous, signature, and system.[1]

16. What is a ContentProvider?

ContentProvider manages structured data access between apps, using a URI-based interface for sharing databases or files.[7]

17. Explain RecyclerView.

RecyclerView efficiently displays lists by recycling views. It requires an Adapter, LayoutManager, and ViewHolder.[3]

18. What causes Android app lag?

Lag occurs from main thread overload, large assets, inefficient code, network delays, or outdated SDKs.[3]

19. What is overdraw in Android?

Overdraw happens when a pixel is drawn multiple times, wasting GPU resources. Use tools like GPU rendering profiler to detect it.[1]

20. How do you handle configuration changes like screen rotation?

Override onSaveInstanceState() to save state, use ViewModel for data persistence, or declare configChanges in manifest.[3]

Advanced Android Interview Questions

For 3-6 years experienced developers, these cover architecture, performance, and modern practices, including scenarios from companies like Atlassian and Adobe.

21. What is MVVM architecture?

MVVM separates View, ViewModel, and Model. ViewModel survives config changes and exposes data via LiveData or StateFlow.[1][3]

22. Explain ViewModel and its benefits.

ViewModel stores UI-related data across config changes. It prevents data loss on rotation and scopes to the Activity/Fragment lifecycle.[1]

23. What is Jetpack?

Android Jetpack is a suite of libraries for consistent, robust apps. It includes ViewModel, LiveData, Navigation, and Room.[1]

24. Scenario: At Atlassian, how would you optimize battery usage in a background sync service?

Use WorkManager for deferrable tasks, respect Doze/App Standby, batch requests, and use JobScheduler for constraints like network availability.[1]

25. What is the NDK?

Native Development Kit allows C/C++ code integration for performance-critical tasks like games or image processing, bypassing GC pauses.[1][3]

26. Differentiate MVP and MVVM.

MVP uses Presenter for logic, tightly coupled to View. MVVM uses data binding for loose coupling and lifecycle-aware components.[3]

27. What is Clean Architecture?

Clean Architecture layers app into Entities, Use Cases, Interface Adapters, and Frameworks. It promotes independence from UI and DB frameworks.[1]

28. Scenario: In an Adobe app, handle real-time data updates across Fragments without memory leaks.

Use SharedViewModel scoped to Activity, with LiveData/Flow for observation. Avoid direct Fragment communication.[1][6]

29. Explain MVI architecture.

MVI (Model-View-Intent) is unidirectional: User intents trigger state changes in Model, updating View reactively.[1]

30. Benefits of multi-module architecture?

Improves build speed, encapsulation, reusability, and parallel development. Use dynamic feature modules for on-demand delivery.[1]

Leave a Reply

Your email address will not be published. Required fields are marked *