Android Developer
400+ Android Developer Interview Questions and Answers
Q51. What is the difference between MVVM (Model-View-ViewModel) and MVC (Model-View-Controller) architectural patterns?
MVVM separates the view and model using a ViewModel, while MVC separates the view and model using a controller.
In MVVM, the ViewModel acts as an intermediary between the view and model, handling user interactions and updating the model accordingly.
In MVC, the controller is responsible for handling user input, updating the model, and updating the view.
MVVM allows for better separation of concerns and easier unit testing of the ViewModel.
MVC can lead to tighter coupling between...read more
Q52. Describe the differences between AsyncTask and RxJava for handling background tasks in Android.
AsyncTask is a built-in class for handling background tasks in Android, while RxJava is a library that provides a more flexible and powerful approach.
AsyncTask is a class provided by the Android framework, while RxJava is a third-party library.
AsyncTask is based on the traditional thread and callback model, while RxJava uses the concept of Observables and allows for more complex asynchronous operations.
RxJava provides operators that can be used to transform, filter, and combi...read more
Q53. How many years of experience do you have with Flutter, Java, and Kotlin?
I have 3 years of experience with Flutter, 5 years with Java, and 2 years with Kotlin.
3 years of experience with Flutter
5 years of experience with Java
2 years of experience with Kotlin
Q54. What are the differences between Native, Hybrid, and Cross Platform development?
Native, Hybrid, and Cross Platform development differ in their approach to building mobile applications.
Native development involves building apps specifically for a single platform using the platform's native programming languages and tools (e.g. Java/Kotlin for Android, Swift/Objective-C for iOS).
Hybrid development uses web technologies like HTML, CSS, and JavaScript to build apps that can run on multiple platforms with the help of frameworks like React Native or Ionic.
Cross...read more
Q55. What are the life cycles of Activity and Fragment in Android development?
Activity and Fragment have different life cycles in Android development.
Activity life cycle includes onCreate, onStart, onResume, onPause, onStop, onDestroy
Fragment life cycle includes onAttach, onCreate, onCreateView, onActivityCreated, onStart, onResume, onPause, onStop, onDestroyView, onDestroy, onDetach
Activity can contain multiple fragments with their own life cycles
Q56. What is co routines in Kotlin, and how does it differ from AsyncTask and WorkManager?
Coroutines in Kotlin are lightweight threads that help manage asynchronous tasks efficiently.
Coroutines are more efficient than AsyncTask as they can handle multiple tasks concurrently without creating new threads.
Coroutines are more flexible and easier to use compared to AsyncTask.
Coroutines can be easily cancelled, unlike AsyncTask which can lead to memory leaks if not handled properly.
WorkManager is recommended for background tasks that need to be guaranteed to run, while ...read more
Share interview questions and help millions of jobseekers 🌟
Q57. What is the difference between Stateful and Stateless widgets in Flutter?
Stateful widgets maintain state that might change during the lifetime of the widget, while stateless widgets are immutable and do not change.
Stateful widgets have a State object that can hold dynamic information and can be updated over time.
Stateless widgets are immutable and their properties cannot change once they are initialized.
Stateful widgets are used when the UI can change dynamically based on user interactions or other factors.
Stateless widgets are used for static con...read more
Q58. What tools or techniques do you use for managing state in Flutter and native Android development?
In Flutter, I use Provider package for state management. In native Android development, I use LiveData and ViewModel.
In Flutter, use Provider package for managing state efficiently
In native Android development, use LiveData and ViewModel to handle state changes
Consider using Redux or MobX for more complex state management in Flutter
Android Developer Jobs
Q59. What is the difference between an activity and fragement in an Android application?
Activity is a single screen with a user interface, while Fragment is a portion of the user interface in an activity.
Activity is a standalone component that can be launched by an application, while Fragment is a reusable component that can be added to an activity.
An activity can contain multiple fragments, but a fragment cannot contain multiple activities.
Fragments are used to create a flexible and dynamic UI, while activities are used to manage the lifecycle and navigation of...read more
Q60. What is LazyColumn in Jetpack Compose and how is it used?
LazyColumn is a vertically scrolling list that only composes and lays out the items that are visible on the screen.
LazyColumn is part of Jetpack Compose, a modern Android UI toolkit.
It is used to efficiently display large lists of items by only rendering the items that are currently visible on the screen.
LazyColumn is similar to RecyclerView in traditional Android development.
It automatically recycles items as they scroll off the screen, improving performance and reducing mem...read more
Q61. What are SOLID principles in OOP languages?
SOLID principles are a set of five design principles that help in creating maintainable and scalable software applications.
S - Single Responsibility Principle (SRP)
O - Open-Closed Principle (OCP)
L - Liskov Substitution Principle (LSP)
I - Interface Segregation Principle (ISP)
D - Dependency Inversion Principle (DIP)
Q62. How do you find a missing element in an array?
To find a missing element in an array, iterate through the array and compare each element with a range of expected values.
Sort the array if it is unsorted.
Iterate through the array and compare each element with a range of expected values.
If an element is missing, return it.
If no element is missing, return null or -1.
Q63. Advantages of Kotlin over Java, High-order function, extension function, Scope functions, Latinit vs lazy, val vs var, val vs const and other basic Kotlin questions
Advantages of Kotlin over Java and basic Kotlin questions
Kotlin is more concise and less error-prone than Java
Kotlin supports null safety and type inference
Kotlin has higher-order functions, extension functions, and scope functions
Kotlin has lazy initialization and immutable variables
Kotlin has const values for compile-time constants
Kotlin is fully interoperable with Java
Examples: val vs var, run vs let, Latinit vs lazy
Q64. What are coroutine, how to secure ur app data, network call in android , ssl pinning, notification's implementation through FCM, android basic questions
Coroutines are a way to perform asynchronous operations in Android, securing app data involves encryption, SSL pinning enhances security, FCM for notifications.
Coroutines are used for managing asynchronous operations in Android, allowing for efficient and non-blocking code execution.
Securing app data involves using encryption techniques such as AES to protect sensitive information from unauthorized access.
SSL pinning is a security measure that ensures the app only communicate...read more
Q65. How to set the view in the middle in ContraintLayout?
To set a view in the middle in ConstraintLayout, use layout_constraintStart_toStartOf, layout_constraintEnd_toEndOf, layout_constraintTop_toTopOf, and layout_constraintBottom_toBottomOf attributes.
Use layout_constraintStart_toStartOf and layout_constraintEnd_toEndOf to align horizontally in the middle.
Use layout_constraintTop_toTopOf and layout_constraintBottom_toBottomOf to align vertically in the middle.
Set both horizontal and vertical constraints to center the view.
Q66. What is intent and hiw many type are there?
Intent is a messaging object used to request an action from another app component. There are two types of intents: explicit and implicit.
Intent is used to start an activity, service, or broadcast receiver.
Explicit intent specifies the component to be invoked by its name.
Implicit intent specifies the action to be performed and optionally, the data to be used.
Examples of implicit intents are opening a webpage or making a phone call.
Examples of explicit intents are launching a s...read more
Q67. Design the ImageDownloader, with efficiently handling parallel API calls.
ImageDownloader efficiently handles parallel API calls.
Use a thread pool to manage parallel API calls.
Implement caching to avoid redundant API calls.
Use a priority queue to prioritize image downloads.
Optimize network requests by using HTTP/2 or multiplexing.
Consider using a library like Picasso or Glide for image loading and caching.
Q68. What is context? Type of context in android, what are the differences
Context in Android refers to the current state of the application. There are different types of context in Android with varying scopes and lifecycles.
Context is an abstract class in Android that allows access to application-specific resources and classes.
There are three main types of context in Android: Application Context, Activity Context, and Service Context.
Application Context is tied to the lifecycle of the application and is available throughout the application.
Activity...read more
Q69. Does Kotlin support native development for Android?
Yes, Kotlin supports native development for Android through the use of Kotlin/Native.
Kotlin/Native allows developers to compile Kotlin code directly to native binaries, which can be used for Android development.
It enables developers to write platform-specific code in Kotlin for Android apps.
Kotlin/Native also supports interoperability with existing native code written in C or C++.
Q70. What are the SOLID principles of software development?
SOLID principles are a set of five design principles that help make software more maintainable, flexible, and scalable.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open/Closed Principle: Software entities should be open for extension but closed for modification.
L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the program's correctness.
I - Interface Segreg...read more
Q71. what is interface, difference between mvvm and mvp , what is coroutines
Answering questions related to Android development concepts.
Interface is a contract that defines the behavior of a class
MVP and MVVM are architectural patterns used in Android development
MVP separates the presentation layer from the business logic layer
MVVM separates the presentation layer from the business logic layer and provides data binding
Coroutines are a way to perform asynchronous operations in a sequential manner
Q72. What is thread in Java and how a thread can be created?
A thread in Java is a lightweight unit of execution that can run concurrently with other threads.
Threads allow multiple tasks to be executed simultaneously in a program.
A thread can be created by extending the Thread class or implementing the Runnable interface.
Example of creating a thread using the Thread class: Thread thread = new MyThread();
Example of creating a thread using the Runnable interface: Thread thread = new Thread(new MyRunnable());
Q73. How do you do DeepLinking in android.
Deep linking in Android allows users to navigate directly to specific content within an app.
Deep linking is achieved by defining intent filters in the app's manifest file.
The intent filter specifies the URL scheme and host that the app can handle.
When a deep link is clicked, Android checks if any app can handle the URL and prompts the user to choose.
The chosen app receives the deep link data in the intent's data field.
Deep linking can be used to open specific screens, perform...read more
CyclicBarrier in Java is a synchronization aid that allows a set of threads to wait for each other to reach a common barrier point.
CyclicBarrier is initialized with a count of the number of threads that must invoke await() before the barrier is tripped.
Threads wait at the barrier until all threads have invoked await(), then the barrier is released.
Once the barrier is tripped, it can be reused for subsequent synchronization points.
CyclicBarrier can be used in scenarios where m...read more
Q75. What is the concept of Object-Oriented Programming (OOP)?
OOP is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
OOP focuses on creating objects that interact with each other to solve problems.
Objects have attributes (data) and methods (functions) that define their behavior.
Encapsulation, inheritance, and polymorphism are key principles of OOP.
Example: In a banking application, a 'Customer' object could have attributes like name and account balan...read more
Q76. What is the purpose of the Modifier in Jetpack Compose?
Modifiers in Jetpack Compose are used to apply styling, layout, and behavior to UI elements.
Modifiers are used to modify the appearance, layout, and behavior of UI elements in Jetpack Compose.
They can be used to add padding, alignment, background color, click listeners, and more to UI elements.
Modifiers are composable functions that can be chained together to create complex UI layouts.
Examples of modifiers include padding(), background(), clickable(), and align().
Q77. Fragments and why is it used?
Fragments are reusable UI components in Android used to create flexible and dynamic user interfaces.
Fragments allow for modularization of UI components
They can be reused across multiple activities
They can be added or removed dynamically at runtime
They help in creating responsive UIs for different screen sizes
Example: A news app can use a fragment to display a list of articles and another fragment to display the details of a selected article
Q78. val sharedPref = activity?.getPreferences(Context.MODE_PRIVATE) ?: return with(sharedPref.edit()){ putInt(getString(R.string.saved_high_score_key), newHighScore) apply() }
The code snippet is used to save a high score in shared preferences in an Android app.
The code checks if the activity is not null before getting the shared preferences.
It then retrieves an editor for the shared preferences to save a new high score.
The new high score is stored using apply() method to save the changes immediately.
Q79. Survival of view model during configration changes.
View model survives configuration changes in Android.
View model is retained during configuration changes by default.
It is stored in the ViewModelStore of the activity or fragment.
It can be accessed using ViewModelProviders.
It helps in preserving data and state during configuration changes.
Q80. Why Java not fully object oriented language?
Java is not fully object-oriented because it supports primitive data types and has static methods.
Java has primitive data types like int, float, etc. which are not objects.
Java allows the use of static methods which do not belong to any object.
Java does not support multiple inheritance, which is a characteristic of fully object-oriented languages.
However, Java supports encapsulation, inheritance, and polymorphism, which are key features of object-oriented programming.
Q81. In Livedata what is difference between senddata and postdata
In LiveData, the difference between sendData and postData is that sendData delivers data immediately, while postData delivers data after a delay.
sendData delivers data immediately to all active observers.
postData delivers data after a delay to all active observers.
sendData is synchronous, while postData is asynchronous.
Q82. What is difference between Parecelable and Serializable
Parcelable is faster and more efficient than Serializable.
Parcelable is an Android-specific interface while Serializable is a Java interface.
Parcelable is faster and more efficient than Serializable.
Parcelable requires more work to implement than Serializable.
Parcelable is used to pass data between Android components while Serializable is used for general serialization.
Parcelable is preferred for performance-critical operations.
Q83. What is the difference between interface and abstract class?
Interface defines only method signatures while abstract class can have both method signatures and implementations.
An interface can be implemented by multiple classes while a class can only extend one abstract class.
An abstract class can have constructors while an interface cannot.
An abstract class can have non-abstract methods while an interface can only have abstract methods.
An abstract class can have instance variables while an interface cannot.
Example: Interface - OnClickL...read more
Q84. Components of Android?
Android has four main components: Activities, Services, Broadcast Receivers, and Content Providers.
Activities: UI components that represent a single screen with a user interface.
Services: Background components that perform long-running operations.
Broadcast Receivers: Respond to system-wide broadcast announcements.
Content Providers: Manage a shared set of app data that can be accessed by other apps.
Q85. Difference between an array, array-list, and vector?
Array is a fixed-size collection, ArrayList is a dynamic-size collection, and Vector is a synchronized dynamic-size collection.
Array is a basic data structure with a fixed size.
ArrayList is a resizable array implementation of the List interface.
Vector is similar to ArrayList but is synchronized, making it thread-safe.
Example: String[] names = new String[5];
Example: ArrayList
names = new ArrayList<>(); Example: Vector
names = new Vector<>();
Q86. What is intent services? Intent service vs service
Intent Service is a subclass of Service that performs a single operation on a separate thread.
Intent Service is used for long-running operations that do not require user interaction.
It is started with an Intent and runs on a separate thread.
It stops itself automatically when the operation is complete.
It can be used for tasks like downloading a file or uploading data to a server.
Intent Service is useful for performing background tasks without affecting the UI thread.
Q87. What are the different android components?
Android components are building blocks of an Android app. They include activities, services, broadcast receivers, and content providers.
Activities - UI components that handle user interactions
Services - Background components that perform long-running operations
Broadcast Receivers - Respond to system-wide broadcast announcements
Content Providers - Manage shared app data
Q88. Tell me about the oops with real time examples
Object-oriented programming concepts with examples
Encapsulation: Wrapping data and methods into a single unit. Example: Class Car with properties like make, model, and methods like start(), stop().
Inheritance: Reusing code from existing classes. Example: Class SUV inheriting from Class Car.
Polymorphism: Ability to take multiple forms. Example: Method overloading in Java.
Abstraction: Hiding complex implementation details. Example: Interface in Java.
Encapsulation: Binding data ...read more
Q89. Project starting to end developer process
The developer process for a project involves planning, designing, coding, testing, and deployment.
Plan the project and gather requirements
Design the architecture and user interface
Code the application using best practices and coding standards
Test the application thoroughly to ensure quality and functionality
Deploy the application to the desired platform and monitor its performance
Continuously maintain and update the application as needed
Q90. Wirte code for how to stored data in shared preference
Shared preferences are used to store key-value pairs in Android applications.
Create a SharedPreferences object using getSharedPreferences() method
Use SharedPreferences.Editor to add data to the shared preferences
Commit the changes using apply() or commit() method
Q91. 1.Activity Life cycle 2.Difference between onPause() and onStop() 3.Difference between onRestart() and onResume() 4.AsyncTask 5.what happened if we rotate the screen
Questions related to Android development concepts and features.
Activity lifecycle includes onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy() methods.
onPause() is called when the activity is partially visible, while onStop() is called when the activity is no longer visible.
onRestart() is called when the activity is stopped and then started again, while onResume() is called when the activity is resumed from the paused state.
AsyncTask is used to perform backgro...read more
Q92. Explain features of Android development
Android development features include open-source platform, rich development environment, and extensive libraries.
Open-source platform allows for customization and flexibility
Rich development environment with tools like Android Studio
Extensive libraries for various functionalities like UI, networking, and database
Support for multiple hardware devices and screen sizes
Integration with Google services like Maps, Firebase, and Play Store
Ability to create interactive and engaging u...read more
Q93. What is java
Java is a high-level programming language used for developing a wide range of applications, including Android apps.
Java is an object-oriented language.
It is platform-independent, meaning it can run on any operating system.
Java uses a virtual machine called the Java Virtual Machine (JVM) to execute code.
It has a large standard library with built-in classes and methods for common programming tasks.
Java is known for its simplicity, readability, and robustness.
Q94. How to create singleton class? What is the use of Proguard and How Proguard internally works? Write code to implement ViewModel What is the difference between apk and aab?
A singleton class is a class that can only have one instance created at a time. Proguard is a tool used for code obfuscation and optimization. ViewModel is a class that stores and manages UI-related data.
To create a singleton class, make the constructor private, create a static method to return the instance, and use a static variable to hold the instance.
Proguard is used to shrink, optimize, and obfuscate the code in an Android application to make it smaller and more efficien...read more
Q95. Have you worked with ViewPager2 and ListAdapter?
Yes, I have experience working with ViewPager2 and ListAdapter.
Implemented ViewPager2 to create swipeable screens in Android apps.
Utilized ListAdapter to efficiently manage data for RecyclerViews.
Used ListAdapter's DiffUtil to efficiently update RecyclerView items.
Q96. What are the components of the Android App?
The components of an Android app include activities, services, broadcast receivers, and content providers.
Activities: UI components that represent a single screen with a user interface.
Services: Background tasks that run independently of the UI.
Broadcast Receivers: Respond to system-wide broadcast announcements.
Content Providers: Manage a shared set of app data.
Q97. Why maven centre, jcentre in gradle build?
Maven Central and JCenter are popular repositories for managing dependencies in Gradle build scripts.
Maven Central is the default repository for Apache Maven, containing a vast number of open-source libraries and artifacts.
JCenter is a curated repository maintained by Bintray, providing a wide range of popular libraries and artifacts.
Using these repositories in Gradle build scripts simplifies dependency management and ensures easy access to required libraries.
Q98. What is coroutines? Launch mode of coroutines.
Coroutines are a way to perform asynchronous operations in a sequential manner. Launch modes include launch, async, and runBlocking.
Coroutines are lightweight threads that can be used for asynchronous programming in Kotlin.
Launch mode 'launch' starts a new coroutine and does not return any result.
Launch mode 'async' starts a new coroutine and returns a 'Deferred' object that can be used to retrieve the result.
Launch mode 'runBlocking' blocks the current thread until the corou...read more
Q99. What are the SOLID principles in Android development?
SOLID principles are a set of five design principles that help developers create more maintainable and scalable code.
Single Responsibility Principle (SRP) - A class should have only one reason to change.
Open/Closed Principle (OCP) - Classes should be open for extension but closed for modification.
Liskov Substitution Principle (LSP) - Objects of a superclass should be replaceable with objects of its subclasses without affecting the program's correctness.
Interface Segregation P...read more
Q100. Explain the Activity lifecycle in Android.
The Activity lifecycle in Android refers to the sequence of events that occur during the lifespan of an Activity.
An Activity goes through several states, including onCreate, onStart, onResume, onPause, onStop, and onDestroy.
Each state has its own purpose and is triggered by specific events, such as the user opening or closing the app.
Understanding the Activity lifecycle is crucial for managing resources, saving and restoring state, and providing a smooth user experience.
Interview Questions of Similar Designations
Top Interview Questions for Android Developer Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month