Senior Android Developer

100+ Senior Android Developer Interview Questions and Answers

Updated 21 Feb 2025

Q51. How retrofit is integrated

Ans.

Retrofit is integrated in Android apps using a few simple steps.

  • Add Retrofit dependency in build.gradle file

  • Create an interface with API endpoints using Retrofit annotations

  • Instantiate Retrofit object with base URL and converter factory

  • Create API service using the interface and Retrofit object

  • Make API calls using the service and handle responses

Q52. How to create custom UI

Ans.

Custom UI can be created by designing layouts using XML or programmatically in Android.

  • Design UI elements using XML in layout files

  • Customize UI elements programmatically using Java or Kotlin

  • Use libraries like ConstraintLayout for complex layouts

  • Implement custom views by extending existing views or creating new ones

Q53. Generics in kotlin and java interportability with kotlin

Ans.

Generics in Kotlin and Java can be used interchangeably, but there are some differences in syntax and features.

  • Kotlin supports declaration-site variance, while Java supports use-site variance.

  • In Kotlin, you can use reified generics with inline functions, which is not possible in Java.

  • Kotlin has nullable types by default, while in Java you need to use wildcards for similar behavior.

Q54. How will you handle prod defects

Ans.

Prod defects are handled by identifying, prioritizing, and resolving them in a systematic manner.

  • Create a process for reporting and tracking defects

  • Prioritize defects based on impact and severity

  • Assign resources to investigate and fix defects

  • Perform root cause analysis to identify the underlying issues

  • Implement fixes and thoroughly test them before deploying

  • Communicate with stakeholders about the status and resolution of defects

Are these interview questions helpful?

Q55. Different activity launch modes, services, intent-services

Ans.

Different launch modes control how activities are launched, services run in the background, and intent-services handle asynchronous tasks.

  • Launch modes include standard, singleTop, singleTask, and singleInstance

  • Services are used for long-running operations in the background

  • Intent-services are used for handling asynchronous tasks on a separate worker thread

Q56. what is Corotuine and explain builder type.

Ans.

Coroutines are a way to perform asynchronous programming in Android. Builder type is used to create and configure a coroutine.

  • Coroutines in Android are used for managing asynchronous tasks without blocking the main thread.

  • Builder type is used to create a coroutine with specific configuration options.

  • Example: 'launch' is a builder type used to start a new coroutine.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q57. Difference betwwen MVVM and Clean architecture?

Ans.

MVVM focuses on separating the UI from the business logic, while Clean architecture emphasizes separation of concerns and layers.

  • MVVM stands for Model-View-ViewModel, where the ViewModel acts as a mediator between the View and the Model.

  • Clean architecture divides the app into layers (domain, data, presentation) with clear boundaries and dependencies.

  • MVVM is more suitable for small to medium-sized projects, while Clean architecture is better for larger, complex projects.

  • MVVM i...read more

Q58. What is most efficient layout to use on android

Ans.

ConstraintLayout is the most efficient layout to use on Android.

  • Allows for flat view hierarchy

  • Handles complex layouts efficiently

  • Supports responsive design

  • Provides tools for optimizing layouts

Senior Android Developer Jobs

Senior Android Developer - Filament Design System 8-13 years
Philips India Limited
3.9
Bangalore / Bengaluru
Senior Android Developer 5-10 years
Way Dot Com
4.6
₹ 18 L/yr - ₹ 25 L/yr
Kochi
Senior Android Developer 7-8 years
Nielsen Sports
3.9
Bangalore / Bengaluru

Q59. What is Coroutine and Suspend function

Ans.

Coroutines are a way to perform asynchronous operations in a sequential manner in Kotlin. Suspend functions are functions that can be paused and resumed.

  • Coroutines in Kotlin are used for asynchronous programming without blocking the main thread.

  • Suspend functions are used within coroutines to perform long-running tasks without blocking the thread.

  • Coroutines can be used to handle network requests, database operations, and other asynchronous tasks efficiently.

  • Example: 'suspend f...read more

Q60. What is the coroutines? Lazy and lateint Sealed classes

Ans.

Coroutines are a way to perform asynchronous programming in a more structured and readable manner in Android development.

  • Coroutines are lightweight threads that can be used to perform long-running tasks without blocking the main thread.

  • They simplify asynchronous programming by allowing developers to write code that looks synchronous, making it easier to understand and maintain.

  • Coroutines can be used for tasks like network requests, database operations, and other IO-bound oper...read more

Q61. Git pull vs pull request?

Ans.

Git pull is used to fetch and merge changes from a remote repository, while pull request is a way to propose changes to a repository.

  • Git pull is used to update a local repository with changes from a remote repository.

  • Pull request is a way to propose changes to a repository by creating a branch, making changes, and requesting the changes to be merged into the main branch.

  • Git pull is a command used in the terminal, while pull request is a feature on Git hosting platforms like G...read more

Q62. Diffr between MVP and MVVM.

Ans.

MVP and MVVM are architectural patterns used in Android development.

  • MVP stands for Model-View-Presenter and separates the presentation layer from the business logic.

  • MVVM stands for Model-View-ViewModel and separates the presentation layer from the data layer.

  • MVP uses a passive view, where the view is dumb and only displays data provided by the presenter.

  • MVVM uses a reactive view, where the view observes changes in the ViewModel and updates itself accordingly.

  • MVP is easier to ...read more

Q63. what is Intent Lifecycle of Fragment

Ans.

Intent is a messaging object used to request an action from another app component.

  • Intent is used to start activities, services, and broadcast receivers in Android.

  • It can also be used to pass data between components.

  • There are two types of intents: explicit intents and implicit intents.

Q64. what is anr how to prevent

Ans.

ANR stands for Application Not Responding, it occurs when the main UI thread is blocked for too long.

  • ANR can be prevented by offloading long-running tasks to background threads or services.

  • Optimizing code and reducing UI thread workload can also help prevent ANR.

  • Using tools like StrictMode can help identify potential ANR issues during development.

Q65. Activity Lifecycle when screen rotate.

Ans.

Activity lifecycle is affected when screen rotates, causing onPause, onStop, onDestroy, onCreate, onStart, and onResume to be called in sequence.

  • When screen rotates, onPause is called to pause the activity

  • onStop is called next to stop the activity

  • onDestroy is called to destroy the activity

  • onCreate is called to recreate the activity

  • onStart is called to start the activity

  • onResume is called to resume the activity

Q66. System Design based on android applications

Ans.

System design for android applications involves planning the architecture, components, and interactions of the app.

  • Identify the key features and functionalities of the app

  • Design the user interface and user experience (UI/UX)

  • Choose the appropriate architecture pattern (e.g. MVC, MVP, MVVM)

  • Consider scalability, performance, and security

  • Implement data storage solutions (e.g. SQLite, Room, Firebase)

  • Integrate with external APIs and services

  • Test and optimize the app for different d...read more

Q67. Explain about jet compose

Ans.

Jet Compose is a modern UI toolkit for building native Android apps using a declarative approach.

  • Jet Compose is a declarative UI framework for building Android apps.

  • It allows developers to create UI components using Kotlin code.

  • Jet Compose simplifies UI development by eliminating the need for XML layouts.

  • It provides a more flexible and efficient way to create dynamic UIs.

  • Jet Compose is part of the Jetpack libraries provided by Google.

Q68. Extension function in kotlin

Ans.

Extension functions in Kotlin allow you to add new functions to existing classes without modifying their source code.

  • Extension functions are defined outside of the class they extend.

  • They can be called on instances of the class as if they were regular methods.

  • They can access the properties and methods of the class they extend.

  • Example: fun String.isEmailValid(): Boolean { ... }

  • Example: fun Int.isEven(): Boolean { ... }

Q69. Null safety in kotlin

Ans.

Null safety in Kotlin ensures that variables cannot hold null values unless explicitly specified.

  • Kotlin uses nullable and non-nullable types to enforce null safety.

  • The '?' operator is used to declare a variable as nullable.

  • Safe call operator '?.' is used to safely access properties or methods of nullable objects.

  • The '!!' operator is used for force unwrapping nullable types, but can lead to NullPointerExceptions.

Q70. Room data base explanation

Ans.

Room database is a persistence library that provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.

  • Room database simplifies database interactions by providing compile-time verification of SQL queries.

  • It consists of three main components: Entity, DAO (Data Access Object), and Database.

  • Entities represent tables in the database, DAOs define methods to interact with the database, and Database is the main access...read more

Q71. Sealed claa in kotlin

Ans.

Sealed classes in Kotlin are used to represent restricted class hierarchies.

  • Sealed classes can have a limited set of subclasses defined within the same file.

  • They are useful for representing a fixed set of types in a hierarchy.

  • Sealed classes are often used in when expressions for exhaustive checks.

Q72. recyclerview practical impl with itemview

Ans.

RecyclerView is used to display large sets of data efficiently. ItemView is used to define the layout of each item in the list.

  • RecyclerView is a more advanced version of ListView and GridView

  • ItemView is a layout file that defines the UI for each item in the list

  • RecyclerView.Adapter is used to bind the data to the views

  • RecyclerView.LayoutManager is used to define the layout of the RecyclerView

  • RecyclerView.ViewHolder is used to hold the views for each item in the list

Q73. What is Concurrency Design Pattern?

Ans.

Concurrency design pattern is a design pattern that deals with managing multiple tasks or processes simultaneously.

  • Concurrency design patterns help in improving performance and efficiency in multi-threaded applications.

  • Examples of concurrency design patterns include Producer-Consumer, Reader-Writer, and Thread Pool.

  • These patterns help in avoiding issues like race conditions, deadlocks, and resource contention.

Q74. How does a viewmodel work internally

Ans.

A viewmodel is a class that stores and manages UI-related data in a lifecycle-conscious way.

  • Viewmodel survives configuration changes like screen rotations

  • It is not destroyed when the activity is destroyed

  • It is typically used to hold data for the UI to display

Q75. What is immutable class?

Ans.

Immutable class is a class whose instances cannot be modified after creation.

  • Immutable classes have all their fields marked as final, so they cannot be changed once initialized.

  • Immutable classes typically have no setter methods, only getter methods.

  • Examples of immutable classes in Java include String, Integer, and LocalDate.

Q76. What is SharedViewmode?

Ans.

SharedViewModel is a class that is used to share data between fragments in an Android app.

  • SharedViewModel is a part of the Android Architecture Components.

  • It allows fragments to communicate with each other without directly referencing each other.

  • SharedViewModel is typically used to share data between fragments in a single activity.

Q77. Why do we use Viewmodel?

Ans.

Viewmodel is used to store and manage UI-related data in a lifecycle-conscious way.

  • Viewmodel survives configuration changes like screen rotations

  • Prevents memory leaks by separating UI data from UI controller

  • Improves app performance by reducing the need to reload data

Q78. Coroutine in Kotlin, Clean architecture etc

Ans.

Coroutines in Kotlin are used for asynchronous programming, while Clean Architecture is a software design pattern that separates concerns.

  • Coroutines in Kotlin allow for asynchronous programming without the need for callbacks or complex threading mechanisms.

  • Clean Architecture is a software design pattern that separates the application into layers, such as presentation, domain, and data, to improve maintainability and testability.

  • Combining coroutines with Clean Architecture can...read more

Q79. Find the anagram of small string into large string

Ans.

Check if an anagram of a small string exists in a large string

  • Create a frequency map of characters in the small string

  • Iterate through the large string and check if a substring of the same length has the same frequency map

  • Return true if an anagram is found, false otherwise

Q80. Find the length of array with unique items

Ans.

Count the number of unique items in an array of strings

  • Create a Set to store unique items

  • Iterate through the array and add each item to the Set

  • Return the size of the Set as the length of the array with unique items

Q81. Types of job in kotlin coroutine

Ans.

Types of jobs in Kotlin coroutine include launch, async, withContext, and runBlocking.

  • launch: starts a new coroutine without blocking the current thread

  • async: starts a new coroutine and returns a Deferred object with a result

  • withContext: switches the coroutine context within a coroutine

  • runBlocking: blocks the current thread until the coroutine inside it is completed

Q82. What is high order function?

Ans.

A high order function is a function that can take other functions as parameters or return functions as results.

  • High order functions can be used to create more flexible and reusable code.

  • They allow for functions to be passed as arguments, making code more modular.

  • Examples include map, filter, and reduce functions in functional programming.

Q83. What is activity vs fragment

Ans.

Activity is a single screen with a user interface, while Fragment is a modular section of an activity.

  • Activity represents a single screen with a user interface.

  • Fragment is a modular section of an activity that can be combined with other fragments to create a multi-pane UI.

  • Activities are used to handle user interactions and manage the lifecycle of an app.

  • Fragments are reusable components that can be added or removed from an activity dynamically.

  • Activities are typically used fo...read more

Q84. What is suspend function

Ans.

A suspend function is a function that can be paused and resumed later without blocking the main thread.

  • Suspend functions are used in Kotlin coroutines to perform asynchronous operations.

  • They are defined using the 'suspend' keyword.

  • Suspend functions can only be called from other suspend functions or from coroutine scopes.

  • They can be used to perform network requests, database operations, or any other long-running tasks without blocking the main thread.

  • Suspend functions can be u...read more

Q85. difference between remember and rememberSaveable

Ans.

remember is used to store a value in a composable function, while rememberSaveable is used to store a value that survives configuration changes.

  • remember is used to store a value that does not survive configuration changes

  • rememberSaveable is used to store a value that survives configuration changes, such as rotation of the device

  • rememberSaveable is typically used for storing view model data in Jetpack Compose

Q86. Life cycle of android activity

Ans.

The life cycle of an Android activity refers to the sequence of states an activity goes through during its lifetime.

  • An activity is created with onCreate()

  • It becomes visible with onStart()

  • It becomes interactive with onResume()

  • It goes to the background with onPause()

  • It is stopped with onStop()

  • It is destroyed with onDestroy()

  • It can be recreated with onRestart()

  • Configuration changes can trigger different methods like onConfigurationChanged()

  • The activity can also be killed by the ...read more

Q87. Design a Image loading library?

Ans.

Designing an efficient image loading library for Android applications.

  • Support for loading images from various sources like network, disk, and resources.

  • Caching mechanism to store and retrieve images for faster loading.

  • Ability to handle image resizing and scaling for different screen sizes.

  • Support for asynchronous loading to prevent UI thread blocking.

  • Integration with popular image loading libraries like Picasso or Glide for additional features.

  • Option to cancel image loading r...read more

Q88. If Flow lifecycle aware

Ans.

Flow lifecycle aware means using Kotlin Flow with lifecycle awareness in Android development.

  • Flow lifecycle aware helps manage data streams in Android apps

  • It ensures that data emissions are only observed when the lifecycle is in the appropriate state

  • Example: Using Flow with LiveData to update UI components based on lifecycle events

Q89. what is Higher order function

Ans.

Higher order function is a function that can take other functions as parameters or return functions as results.

  • Higher order functions can be passed as arguments to other functions.

  • Higher order functions can return functions as results.

  • Examples include map, filter, and reduce functions in functional programming.

Q90. what is inline keyword

Ans.

The inline keyword is used in Kotlin to suggest that a function should be inlined at the call site.

  • Used to eliminate the overhead of function calls by copying the function code directly at the call site

  • Helps in improving performance by reducing the function call overhead

  • Should be used for small functions or lambdas to avoid unnecessary function call overhead

Q91. 2nd and 3rd largest number finding?

Ans.

To find the 2nd and 3rd largest numbers in an array, sort the array in descending order and then pick the 2nd and 3rd elements.

  • Sort the array in descending order

  • Pick the 2nd and 3rd elements from the sorted array

Q92. name types on collections in Kotlin

Ans.

Kotlin provides several types of collections, including arrays and lists, to store and manipulate data.

  • Kotlin arrays are fixed-size collections that store elements of the same type.

  • Kotlin lists are dynamic-size collections that can store elements of different types.

  • To create an array of strings in Kotlin, you can use the Array type.

  • Alternatively, you can use the shortcut syntax StringArray.

  • Example: val names: Array = arrayOf("John", "Jane", "Alice")

Q93. What is Mvvm architechure?

Ans.

MVVM architecture is a design pattern that separates the user interface from the business logic in an Android app.

  • Model represents the data and business logic

  • View displays the UI and interacts with the user

  • ViewModel acts as a mediator between the Model and View, handling communication and logic

Q94. Explain about MVVM

Ans.

MVVM is an architectural pattern used in software development, particularly in Android apps, to separate the user interface from the business logic.

  • MVVM stands for Model-View-ViewModel

  • Model represents the data and business logic

  • View is the UI component that displays the data and interacts with the user

  • ViewModel acts as a mediator between the Model and View, handling user interactions and updating the Model

  • MVVM helps in separating concerns, making code more modular and easier ...read more

Q95. Different Types of Intent

Ans.

Different types of Intent in Android are explicit and implicit intents.

  • Explicit Intent: Used to start a specific component within the same application.

  • Implicit Intent: Used to request an action from another app component.

  • Example: Explicit Intent - startActivity(new Intent(this, SecondActivity.class));

  • Example: Implicit Intent - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));

Q96. What is fragment and uses.

Ans.

Fragments are modular sections of an activity's user interface, allowing for more flexible and dynamic UI designs.

  • Fragments can be reused across multiple activities

  • They help in creating responsive UIs for different screen sizes

  • Fragments can be added or removed dynamically during runtime

  • They are useful for implementing multi-pane layouts on tablets

Q97. How Viewmodel work?

Ans.

ViewModel is a class that stores and manages UI-related data in a lifecycle-conscious way.

  • ViewModel survives configuration changes such as screen rotations.

  • ViewModel is not destroyed when the activity is destroyed, allowing data to be retained.

  • ViewModel is typically used to hold and manage data for the UI.

Q98. Unit testing with example of code

Ans.

Unit testing is a software testing method where individual units or components of a software are tested in isolation.

  • Unit testing helps in identifying bugs early in the development process.

  • It ensures that each unit of code works correctly on its own.

  • Unit tests are typically written using testing frameworks like JUnit or Mockito.

  • Example: Testing a function that calculates the sum of two numbers.

Q99. Service and Types of Service

Ans.

Services in Android are components that run in the background to perform long-running operations.

  • There are two types of services in Android: Started Services and Bound Services.

  • Started Services are used for tasks that need to run independently of an activity, such as playing music in the background.

  • Bound Services are used to interact with other components in the application, such as activities or fragments.

  • Services can be started using startService() method and stopped using ...read more

Q100. How Coroutine work internally

Ans.

Coroutines are lightweight threads that can be suspended and resumed, allowing for asynchronous programming in a sequential manner.

  • Coroutines are implemented using suspend functions and can be launched using 'launch' or 'async' builders.

  • They are based on the concept of continuation passing style, where the state of the function is saved and can be resumed later.

  • Coroutines can be used to perform long-running tasks without blocking the main thread, improving app performance.

  • The...read more

Previous
1
2
3
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.4k Interviews
3.6
 • 7.5k Interviews
3.7
 • 5.6k Interviews
3.7
 • 4.8k Interviews
3.5
 • 3.8k Interviews
3.7
 • 535 Interviews
3.8
 • 172 Interviews
View all

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

Senior Android Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter