Android Developer

500+ Android Developer Interview Questions and Answers

Updated 5 Jul 2025
search-icon

Asked in Amazon

5d ago

Q. BST Iterator Problem Statement

You are tasked with creating a class named BSTIterator that acts as an iterator for the inorder traversal of a binary search tree. Implement the following functions:

  1. BSTIterator(...read more
Ans.

Create a BSTIterator class for inorder traversal of a binary search tree.

  • Implement a constructor that takes the root of the binary search tree and initializes the iterator.

  • Implement next() function to return the next smallest element in the inorder traversal.

  • Implement hasNext() function to check if there is a next element in the inorder traversal.

  • Traverse the binary search tree in inorder to get the desired output.

Asked in Hike

2d ago

Q. Design a photo viewing app that displays images from the disk in a list, where one item in the list occupies half the screen. Explain all the components used.

Ans.

An 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

Android Developer Interview Questions and Answers for Freshers

illustration image

Asked in Freshworks

1d ago

Q. Cube Sum Pairs Problem Statement

Given a positive integer N, find the number of ways to express N as a sum of cubes of two integers, A and B, such that:

N = A^3 + B^3

Ensure you adhere to the following conditio...read more

Ans.

The problem involves finding the number of ways to express a given positive integer as a sum of cubes of two integers.

  • Iterate through all possible values of A and B within the given constraints.

  • Check if A^3 + B^3 equals the given N, increment the count if true.

  • Handle the case where A = B separately to avoid counting duplicates.

Asked in Amazon

4d ago

Q. Majority Element Problem Statement

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, return -1.

Example:

Inpu...read more
Ans.

Find the majority element in an array, return -1 if no majority element is present.

  • Iterate through the array and keep track of the count of each element using a hashmap.

  • Check if any element's count is greater than floor(N / 2) and return it as the majority element.

  • If no majority element is found, return -1.

Are these interview questions helpful?

Q. Colorful Knapsack Problem

You are given a set of 'N' stones, each with a specific weight and color. The goal is to fill a knapsack with exactly 'M' stones, choosing one stone of each color, so that the total we...read more

Ans.

The Colorful Knapsack Problem involves selecting one stone of each color to fill a knapsack with a given weight capacity, minimizing unused capacity.

  • Iterate through the stones and keep track of the minimum weight for each color.

  • Use dynamic programming to find the optimal solution by considering all possible combinations.

  • Handle cases where the knapsack cannot be filled under the given conditions by returning -1.

  • In the given example, the optimal solution is to select stones wit...read more

Asked in Amazon

2d ago

Q. Find Row With Maximum 1's in a Sorted 2D Matrix

You are provided with a 2D matrix containing only the integers 0 or 1. The matrix has dimensions N x M, and each row is sorted in non-decreasing order. Your objec...read more

Ans.

Find the row with the maximum number of 1's in a sorted 2D matrix.

  • Iterate through each row of the matrix and count the number of 1's in each row.

  • Keep track of the row index with the maximum number of 1's encountered so far.

  • Return the index of the row with the maximum number of 1's.

Android Developer Jobs

Infosys logo
Android Developer- Diversity Bangalore (Pan India Infosys) 3-6 years
Infosys
3.6
₹ 4 L/yr - ₹ 17 L/yr
(AmbitionBox estimate)
Hyderabad / Secunderabad
Google India Private Limited logo
UX Engineer, Android Developer 1-4 years
Google India Private Limited
4.4
Bangalore / Bengaluru
Cognizant logo
Android Developer with Reverse Engineering Role 3-8 years
Cognizant
3.7
Hyderabad / Secunderabad

Asked in Intuit

3d ago

Q. Rearrange Linked List Problem Statement

Given a singly linked list in the form 'L1' -> 'L2' -> 'L3' -> ... 'Ln', your task is to rearrange the nodes to the form 'L1' -> 'Ln' -> 'L2' -> 'Ln-1', etc. You must not...read more

Ans.

Rearrange the nodes of a singly linked list in a specific order without altering the data of the nodes.

  • Use two pointers to split the linked list into two halves.

  • Reverse the second half of the linked list.

  • Merge the two halves alternately to rearrange the nodes.

  • Ensure to handle cases with odd and even number of nodes separately.

  • Example: For input 1 -> 2 -> 3 -> 4 -> 5, the output should be 1 -> 5 -> 2 -> 4 -> 3.

Asked in Amazon

4d ago

Q. Find Missing Number In String Problem Statement

You have a sequence of consecutive nonnegative integers. By appending all integers end-to-end, you formed a string S without any separators. During this process, ...read more

Ans.

Given a string of consecutive nonnegative integers without separators, find the missing integer.

  • Iterate through all possible splits of the string and check if the sequence is valid

  • If the sequence is valid, return the missing integer

  • Handle cases where there are multiple missing integers or the string is invalid

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Amazon

2d ago

Q. LRU Cache Design Question

Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:

1. get(key) - Return the value of the key if it exists in the cache; otherwise, re...read more

Ans.

Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.

  • Implement a doubly linked list to keep track of the order of keys based on their recent usage.

  • Use a hashmap to store key-value pairs for quick access and update.

  • When capacity is reached, evict the least recently used item before inserting a new item.

  • Update the order of keys in the linked list whenever a key is accessed or updated.

Asked in Hike

2d ago

Q. Design a screen that displays a list of the 10 nearest restaurants, updating with more options as the user scrolls. Ensure the scrolling is as smooth as possible.

Ans.

Design 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

Asked in PayPal

1d ago

Q. Integer to Roman Conversion

Given an integer N, convert it to its corresponding Roman numeral representation. Roman numerals comprise seven symbols: I, V, X, L, C, D, and M.

Example:

Input:
N = 2
Output:
II
Exp...read more
Ans.

Convert an integer to its corresponding Roman numeral representation.

  • Create a mapping of integer values to Roman numeral symbols.

  • Iterate through the mapping in descending order of values and build the Roman numeral representation.

  • Subtract the largest possible value from the integer at each step and append the corresponding Roman numeral symbol.

  • Repeat until the integer becomes 0.

Asked in LinkedIn

2d ago

Q. Palindrome Permutation - Problem Statement

Determine if a permutation of a given string S can form a palindrome.

Example:

Input:
string S = "aab"
Output:
"True"
Explanation:

The permutation "aba" of the string ...read more

Ans.

Check if a permutation of a string can form a palindrome.

  • Create a frequency map of characters in the string.

  • Check if at most one character has an odd frequency.

  • If yes, return True; otherwise, return False.

Q. 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 more
Ans.

Android 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

Asked in Hike

4d ago

Q. You have an application that displays a list of all contacts, where names and numbers can be duplicated. How would you implement a search feature that allows users to search by name or number?

Ans.

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

Asked in Hike

3d ago

Q. Given a String, write a function that returns a boolean indicating whether one permutation of the string is a Palindrome or not.

Ans.

Check if any permutation of a string can form a palindrome by analyzing character frequencies.

  • A palindrome reads the same forwards and backwards (e.g., 'racecar').

  • For a string to have a permutation that is a palindrome, at most one character can have an odd frequency.

  • Example: 'civic' -> all characters have even counts except 'v' (1), so it can form a palindrome.

  • Example: 'ivicc' -> 'i' and 'c' appear twice, 'v' appears once, so it can form a palindrome.

  • Example: 'hello' -> 'h',...read more

Asked in Hike

3d ago

Q. Given an Object 'Ball', how would you transfer this ball object from one thread to another, specifically from a thread to the MainThread?

Ans.

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

Asked in Rupeek

3d ago
Q. Can you design a simple waste management app, given a mock server and some icons?
Ans.

A waste management app to track and manage waste disposal

  • Include features for users to log types of waste disposed

  • Implement a map feature to locate nearby waste disposal facilities

  • Allow users to set reminders for waste collection days

  • Incorporate a reward system for eco-friendly waste disposal practices

Asked in Accenture

3d ago

Q. Tell me about your last project, the technologies used, and the app's architecture.

Ans.

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

Asked in Hike

5d ago

Q. If you were asked to implement your own HashMap, how would you do it?

Ans.

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)

Asked in IBM

5d ago

Q. What is Android development?

Ans.

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

Asked in IBM

3d ago

Q. What is the use of Activity Creator?

Ans.

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);

Asked in Hike

5d ago

Q. Given an array of natural numbers in random order, find the first missing natural number in the array. For example, given the array [4, 6, 3, 1, 6, 8], the output should be 2. Given the array [1, 2, 3], the out...

read more
Ans.

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

Q. What is json parsing, how to handle team conflicts, agile methodologies, work experience related questions

Ans.

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

Asked in Brainvire

1d ago

Q. What is the diamond problem, or why does Java not support multiple inheritance?

Ans.

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.

Asked in Trackier

3d ago

Q. How would you automatically log in a user who has entered all details but has no internet connection at submission time, so that when the internet connection is restored, the user is automatically logged in?

Ans.

Implement a local storage mechanism to cache user credentials and auto-login when internet is available.

  • Use SharedPreferences to store user credentials securely.

  • Implement a BroadcastReceiver to listen for network connectivity changes.

  • On successful form submission, save credentials in SharedPreferences if no internet is available.

  • When internet connectivity is restored, retrieve credentials and perform login automatically.

  • Consider using WorkManager for background tasks to handl...read more

Asked in Accenture

1d ago

Q. What is a broadcast, what are the different types of broadcasts, and what are the uses of broadcasts?

Ans.

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

Asked in GlobalLogic

2d ago

Q. Given an array containing only 0s and 1s, how would you move all the 0s to the left and all the 1s to the right?

Ans.

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

Asked in Hike

2d ago
Q. How can you pass a simple Java object from one thread to another?
Ans.

Use a Handler or AsyncTask to pass a Java object between threads.

  • Use a Handler to send messages containing the object from one thread to another.

  • Use AsyncTask to perform background tasks and update UI with the object on the main thread.

Asked in Hike

5d ago

Q. How do loopers and handlers work internally when you pass an object from one thread to another?

Ans.

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

6d ago

Q. Four people (A, B, C, and D) need to cross a bridge at night. A takes 1 minute, B takes 2 minutes, C takes 5 minutes, and D takes 10 minutes to cross. They have only one torch, and the bridge cannot be crossed...

read more
Ans.

Minimum 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.

1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
Capgemini Logo
3.7
 • 5.1k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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

Android Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits