Android Developer
400+ Android Developer Interview Questions and Answers
You are given a positive integer N, and you have to find the number of ways to represent N as a sum of cubes of two integers(let’s say A and B), such that:
N = A^3 + B^3.
Note:
1. A should be gre...read more
You have been given an array/list 'ARR' consisting of 'N' integers. Your task is to find the majority element in the array. If there is no majority element present, print -1.
Note:
A majority el...read more
Android Developer Interview Questions and Answers for Freshers
You are given a class named as BSTIterator that represents an iterator over inorder traversal of a binary search tree. You need to implement the following things as follows:
1. BSTIterator(Node root...read more
Q4. Design an photo viewing app which will show images from the disk in the list, and one item in the list should take half of the screen. (Android app design question, have to explain all the components used in it...
read moreAn Android photo viewing app with a list of images from disk, one taking half the screen.
Use RecyclerView to display the list of images
Use a custom adapter to bind the images to the RecyclerView
Use a GridLayoutManager with span count of 2 to achieve the half-screen effect
Load images from disk using a library like Glide or Picasso
Implement click listeners to handle item selection and display the selected image
Given an integer ‘N’, the task is to find its corresponding Roman numeral.
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol Value I 1 V 5 X 10 L ...read more
You are given 'N' stones labeled from 1 to 'N'. The 'i-th' stone has the weight W[i]. There are 'M' colors labeled by integers from 1 to 'M'. The 'i-th' stone has the color C[i] which is an int...read more
Share interview questions and help millions of jobseekers 🌟
You have been given a singly Linked List in the form of 'L1' -> 'L2' -> 'L3' -> ... 'Ln'. Your task is to rearrange the nodes of this list to make it in the form of 'L1' -> 'Ln' -> 'L2' -> ...read more
You are given a 2D matrix (containing either ‘0’ or ‘1’) of size N x M, where each row is in sorted order. Find the 0-based index of the first row that has the maximum number of...read more
Android Developer Jobs
Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:
1. get(key) - Return the value of the key if the key exists in the cache, o...read more
You are given a string 'S', check if there exists any permutation of the given string that is a palindrome.
Note :
1. A palindrome is a word or phrase that reads the same from forward and ...read more
Deep linking
scope storage
why constraint layout(flat structure, lessrendering, responsive)
how to handle run time permissions for aspecific version
Have you integrated payment gateway in any of...read more
1) Services
2) Running multiple processes parallelly in Intentservice
3) HashMap vs HashSet
4) pending intent vs Sticky Intent
5) Where are abstract classes used in android
6) difference between a...read more
You had a sequence of consecutive nonnegative integers. You appended all integers at the end of each other to form a string ‘S’ without any separators. While appending each integer ...read more
Q14. You have to design screen in which at a time on screen 10 nearest restaurants will be shown in a list. The screen will keep adding more options while scrolling. Scroll in the list should be uninterrupted as pos...
read moreDesign a screen to show 10 nearest restaurants in a list with uninterrupted scrolling.
Use a RecyclerView to display the list of restaurants
Implement a custom adapter to populate the data in the list
Use a location service to get the user's current location
Sort the restaurants based on their distance from the user's location
Load more restaurants as the user scrolls to the end of the list
1) What do you like about android?
2) What do you like other than android?
3) How do you keep update with new updates in android
4) Discussion on projects
5) Any changes would you like to do if i...read more
Intro and projects background
HTTP Response codes
What is an API?
How/when do you use Retry functionality
Why do I want to switch?
When given a new project what would you do? To understand and mai...read more
Q17. What are android components, name of activity lifecycle methods, name of fragment lifecycle methods, if one goes from 1 activity to another what are the activity lifecycle methods that are called in screen 1 an...
read moreAndroid components include activities and fragments, each with their own lifecycle methods. Transitioning from one activity to another triggers specific lifecycle methods in each screen.
Android components include activities and fragments
Activity lifecycle methods: onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy()
Fragment lifecycle methods: onAttach(), onCreate(), onCreateView(), onActivityCreated(), onStart(), onResume(), onPause(), onStop(), onDestroyView()...read more
Why paytm?
How is paytm different from its competition?
What changes you think can be made to make it better?
Can you take your stand for a decision if you believe its correct even when your supe...read more
Q19. You have application which shows list of all contacts, the Name/Numbers can be duplicated. How will you go on and do searching in this. Search term can either exist in Name or in Number.
To search for contacts with duplicate names or numbers, iterate through the list and compare each contact's name and number with the search term.
Iterate through the list of contacts
Compare the search term with each contact's name and number
Return the contacts that match the search term
Design an photo viewing app which will show images from the disk in the list, and one item in the list should take half of the screen.
Q21. Java/Android : Given an Object 'Ball'. How will you transfer this ball object from one thread to another. Same ball object pass from Thread to MainThread.
To transfer the Ball object from one thread to another, we can use Handler or AsyncTask.
Use Handler to post a Runnable to the main thread's message queue
Use AsyncTask to perform background operations and update the UI on the main thread
Pass the Ball object as a parameter or use a shared variable between threads
Q22. Last project and what technology and architecture used in the app?
Developed a social media app using Kotlin and MVVM architecture.
Used Kotlin for coding the app
Implemented MVVM architecture for better code organization
Integrated Firebase for real-time database and authentication
Used Glide library for image loading and caching
Implemented RecyclerView for displaying posts and comments
Q23. If you were asked to make your own HashMap, how will you do it. (As it was used in the first question)
To create my own HashMap, I would use an array of linked lists to handle collisions and implement key-value pairs using a hash function.
Create an array of linked lists to store the key-value pairs
Implement a hash function to generate an index for each key
Handle collisions by adding elements to the linked list at the corresponding index
Support operations like put(key, value), get(key), and remove(key)
Q24. What is Android development
Android development is the process of creating applications for the Android operating system.
Android development involves writing code in Java or Kotlin to create mobile applications.
It includes designing user interfaces, implementing functionality, and testing the app.
Developers use Android Studio, an integrated development environment (IDE), for building Android apps.
Android apps can be published on the Google Play Store and run on various devices.
Examples of Android apps i...read more
Q25. What is use of activity creator
The activity creator is used to create instances of an activity class in Android development.
The activity creator is responsible for instantiating an activity class.
It is typically used when starting a new activity from another activity.
The activity creator can pass data to the new activity through intent extras.
It is commonly used in the onCreate() method of the calling activity.
Example: Intent intent = new Intent(this, SecondActivity.class); startActivity(intent);
Q26. Given an array, which consist of natural numbers only. The elements are in random order, tell the first missing natural number in the array. e.g 4,6,3,1,6,8 o.p - 2 1,2,3 O/P - 4
Given an array of natural numbers in random order, find the first missing natural number.
Sort the array in ascending order
Iterate through the sorted array and compare each element with its index
If the element is not equal to its index + 1, return the missing number
If all elements are in order, return the next natural number after the last element
Q27. What is json parsing, how to handle team conflicts, agile methodologies, work experience related questions
JSON parsing is the process of converting JSON data into a usable format in programming.
JSON parsing is essential for retrieving and manipulating data from APIs or databases.
It involves converting JSON strings into objects or arrays in programming languages like Java or Kotlin.
Handling team conflicts involves effective communication, active listening, and finding compromises.
Agile methodologies focus on iterative development, collaboration, and adapting to change.
Work experie...read more
How to pass a simple Java object from one thread to another?
Q29. What is diamond problem or why java doesn't support multiple inheritance ?
Diamond problem occurs in multiple inheritance where two superclasses have a common method.
Java doesn't support multiple inheritance to avoid diamond problem.
Diamond problem can be solved using interfaces.
Example: class A and class B both have a method named 'display', class C extends A and B, now if we call display() from C, which method will be called?
To avoid ambiguity, Java uses interfaces to achieve multiple inheritance.
Q30. what is broadcast and it's type of broadcast and what is the use of broadcast?
Broadcast is a messaging system in Android that allows communication between different components of an app or between different apps.
Broadcast is a way to send messages to multiple components or apps at once.
There are two types of broadcasts: ordered and unordered.
Ordered broadcasts are delivered to receivers in a specific order, while unordered broadcasts are delivered to all receivers at once.
Broadcasts can be used for various purposes such as sending system events, notify...read more
Q31. Dsa question- move all the zeroes to left and 1s to the right
Move all zeroes to left and ones to right in an array
Iterate through the array from both ends
Swap the elements if left is 1 and right is 0
Stop when left and right pointers meet
Q32. how does looper/handlers work internally when you pass object from one thread to another.
Looper/handlers allow passing objects between threads in Android.
Looper is a message loop that runs in a thread and processes messages from a message queue.
Handlers are used to send messages to the message queue of a looper.
When an object is passed from one thread to another using a handler, it is encapsulated in a message and added to the receiving thread's message queue.
The receiving thread's looper then processes the message and delivers it to the handler's callback method...read more
Design a weather app. (One image for every weather is there on a server) Take care of half downloaded image, try not to consume data of user again.
Q34. Do you handle the code repos and what are the third party libraries are used in your past experience.
Yes, I have experience in handling code repos and have used various third-party libraries.
I have experience in using Git for version control and have managed code repositories on GitHub and Bitbucket.
I have used third-party libraries such as Retrofit, OkHttp, Gson, and Picasso for network operations, JSON parsing, and image loading respectively.
I have also used libraries like ButterKnife and Dagger for dependency injection and RxJava for reactive programming.
I make sure to ke...read more
Q35. Design a weather app. (One image for every weather is there on a server) Take care of half downloaded image, try not to consume data of user again.
A weather app that displays images for different weather conditions, taking care of half downloaded images and minimizing data consumption.
Implement image caching to store downloaded images locally
Check if the image is already downloaded before making a network request
Use a progress bar to indicate the download status of the image
Handle cases where the download is interrupted or incomplete
Implement a mechanism to resume the download from where it left off
Optimize image loadin...read more
Q36. what is the marker interface and when and where to use interface?
Marker interface is an empty interface used to mark a class as having a particular property or behavior.
Marker interface has no methods or fields, it is used to provide metadata to the code.
It is used to indicate that a class has a certain capability or should be treated in a special way.
Examples of marker interfaces are Serializable, Cloneable, and Remote.
Interfaces are used to achieve abstraction and provide a contract for implementing classes.
Interfaces are used to achieve...read more
Q37. Explain the usage of Fragments in Android and when you might prefer using them over Activities.
Fragments are reusable UI components in Android that can be used within activities. They are preferred over activities in certain scenarios.
Fragments allow for modular and reusable UI components.
They can be used to create multi-pane layouts for tablets and larger screens.
Fragments can be added or removed dynamically at runtime.
They can retain their state during configuration changes.
Fragments can communicate with each other and with the hosting activity using interfaces.
Make a simple waster app. Given a mock server and some icons
What are the different launch modes for activities?
Q40. Puzzel : There are 4 persons (A,B,C, and D) who wants to cross a bridge in night . A takes 1 minute to cross the bridge. B takes 2 minutes to cross the bridge. C takes 5 minute to cross the bridge. D takes 10 m...
read moreMinimum time required to cross the bridge is 17 minutes.
A and B cross (2 minutes), A returns (1 minute), C and D cross (10 minutes), B returns (2 minutes), A and B cross (2 minutes).
Always send the fastest person back to minimize time.
Total time taken is the sum of all individual crossing times.
Q41. How to set equal spacing between childs of constraint layout?
To set equal spacing between childs of constraint layout, use the chain style property.
Create a chain of the views that need equal spacing using the chain style property.
Set the chain style to spread inside the constraint layout.
Adjust the margins of the views to control the spacing.
Use the layout_constraintHorizontal_chainStyle or layout_constraintVertical_chainStyle attribute to set the chain style.
Example: app:layout_constraintHorizontal_chainStyle="spread"
Q42. What is the difference between Serializable and Parcelable?
Serializable is a marker interface that allows objects to be converted into a byte stream, while Parcelable is an Android-specific interface for efficient object serialization.
Serializable is a standard Java interface, while Parcelable is an Android-specific interface.
Serializable uses reflection to serialize and deserialize objects, which can be slower and less efficient.
Parcelable requires explicit implementation of methods for serialization and deserialization, making it f...read more
Q43. How much do you know about database? MySQL or SQL Server?
I have a strong understanding of databases, including MySQL and SQL Server.
I am proficient in writing SQL queries and managing databases.
I have experience in designing and implementing database schemas.
I am familiar with database optimization techniques.
I have worked with both MySQL and SQL Server in various projects.
I understand the differences between the two and can work with either one.
What are the IPC mechanisms available in android OS?
Q45. what is oops and its importance ?
OOPS stands for Object-Oriented Programming System. It is a programming paradigm that uses objects to represent real-world entities.
OOPS allows for modular and reusable code.
It provides a clear structure and organization to the code.
Encapsulation, inheritance, and polymorphism are key concepts in OOPS.
Example: In an Android app, each screen can be represented as an object with its own properties and behaviors.
OOPS promotes code reusability and maintainability.
Q46. You have been given a in out time log of viewers and you need to find the highest count of viewers at any given point.
To find highest count of viewers at any given point from in-out time log
Create an array of time slots with start and end time
Loop through the log and increment the count for each time slot
Track the maximum count and corresponding time slot
Return the time slot with highest count
Q47. Memory leakage, how to avoid and identify
Memory leakage can cause app crashes and slow performance. It can be avoided by proper memory management and identifying the root cause.
Avoid creating unnecessary objects
Release unused resources
Use memory profiling tools like Android Profiler
Avoid static references to objects
Use weak references when necessary
Difference between deep links and app links?
Q49. 1)what is difference between abstract class and interface 2)how can you create JDBC application for saving the data
Answering questions on abstract class vs interface and creating JDBC application for data saving.
Abstract class can have method implementations while interface cannot
A class can implement multiple interfaces but can only inherit from one abstract class
JDBC application can be created by loading the driver, establishing connection, creating statement, executing query and closing connection
Example: Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnectio...read more
Q50. What are the different android components and concepts such as Recycler View, View Model, ANR and how do they function internally?
Android components like Recycler View, View Model, ANR are essential for building robust Android applications.
Recycler View: Efficient way to display large data sets by recycling views as they scroll off the screen.
View Model: Manages UI-related data in a lifecycle-conscious way, surviving configuration changes.
ANR (Application Not Responding): Dialog shown to the user when the main thread of an app is blocked for too long.
Understanding how these components work internally is...read more
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