Cheat Sheet for Android Interviews. Updated the list to include the latest android components available in 2024.
- Common Coding Programs
- Data Structure Coding Programs
- Android Interview Series – Part 1 (Android basics)
- Android Interview Series – Part 2 (Android expert)
- Android Interview Series – Part 3 (Java basics)
- Android Interview Series – Part 4 (Kotlin basics)
- Android Interview Series – Part 5 (Kotlin coroutines)
- Android Interview Series – Part 6 (Kotlin Flows)
- Android Interview Series – Part 7 (Jetpack Compose)
-
Arrays
- Find Maximum Sell Profit
- Find Low & High Index of a key from a given array
- Merge Overlapping Intervals
- Move all zeros in an array to the Left or Right
- Rotate an array
- Find the smallest common number in a given array
- Find the sum of two elements in a given array
- Find the minimum distance between two numbers in an array
- Find the maximum difference between the values in an array such that the largest values always comes after the smallest value
- Find second largest element in an array
- Find the 3 numbers in an array that produce the max product
- Find missing number from an array
-
Dynamic Programming
- Fibonacci Series
- Given an array, find the contiguous subarray with the largest sum
- Find the maximum sum of a subsequence such that no consecutive elements are part of the subsequence
- Given a score "n", find the total number of ways score "n" can be reached
- Compute Levenshtein distance between two strings
- Given coin denominations and the total amount, find out the number of ways to make the change
-
Queues
-
LinkedList
- Reverse a Linked List
- Remove duplicates from a Linked List
- Delete Node of a given key from a Linked List
- Find the Middle Node of a Linked List
- Find the Nth Node of a Linked List
- Check if a Linked List is cyclic
- Insertion Sort of a Linked List
- Intersection Point of Two Lists
- Nth from last node
- Swap Nth Node with Head
- Merge Two Sorted Linked Lists
- Sorting LinkedList using merge sort
- Reverse nodes at even indices
- Rotate linked list by n
- Reverse every 'k' elements in a linked list
- Add the head pointers of two linked lists
-
Stacks
- Evaluate an expression
- Implement a stack using queues
- Check if paranthesis are equal
- Tower of Hanoi
- ReverseAStack
-
Back Tracking
- Solve Boggle
- Print paranthesis combination for a given value
- Solve N queen problem
- find all the subsets of the given array that sum up to the number K
-
Graphs
-
Trees
- Implements an InOrder Iterator on a Binary Tree
- Convert a binary tree to a doubly linked list
- Connect a sibling pointer of a binary tree to next node in the same level
- Given a binary tree, connect its siblings at each level
- Delete any subtrees whose nodes sum up to zero
- Given roots of two binary trees, determine if these trees are identical
- Find the Inorder successor of a node in binary Search Tree
- Algorithm to traverse the tree inorder
- Check if a given tree is a binary search tree
- Display node values at each level in a binary tree
- Swap the 'left' and 'right' children for each node in a binary tree
- Find nth highest node in a Binary Search Tree
- Print nodes forming the boundary of a Binary Search Tree
- Serialize binary tree to a file and then deserialize back to tree
-
Strings
- Reverse String
- Palindrone String
- Regular Expression
- Remove Duplicates
- Remove White Spaces
- Remove a String
- String Segmentation
- Find next highest permutation of a given string
- Check if two strings are anagrams
-
Integers
- Reverse Integer
- Find sum of digits of an integer
- Find Next highest Number from a Integer
- Check if it is an Armstrong number
- Find the factorial of a number
- Print all prime numbers upto the given number
- Find all the prime factors of a given integer
- Check if a given number is binary
- Find kth permutation
- Integer Division
- Find Pythagorean Triplets
- Print all possible sum combinations using positive integers
- Find Missing Number
- Find all subsets of a given set of integers
- Given an input string, determine if it makes a valid number
- Calculate 'x' raised to the power 'n'
- Calculate square root of a number
- Minimum Number of Platforms Required for a Railway/Bus Station
-
Miscellaneous
- Find three integers in the array with sum equal to the given value
- Find position of a given key in 2D matrix
- Determine the host byte order of any system
- Find the point that requires the least total distance covered by all the people to meet at that point
- Given a two dimensional array, if any element in it is zero make its whole row and column zero
-
Sorting
- BubbleSort
- InsertionSort
- SelectionSort
- QuickSort
- MergeSort
- Question: Why is quicksort preferred over merge sort for sorting arrays?
- Quicksort does not require any extra storage whereas merge sort requires O(n) space allocation. Allocating/de-allocating memory space can increase the run time.
- Quicksort does not require any extra storage whereas merge sort requires O(n) space allocation. Allocating/de-allocating memory space can increase the run time.
- Question: Why is merge sort preferred over quicksort for sorting linked lists?
- There is a difference in linked lists due to memory allocation. In linked lists we can insert items in the middle in O(n) space and time. There is no extra memory allocation required.
- Question: Why is quicksort preferred over merge sort for sorting arrays?
-
Searching
- Binary Search
- Rotated Binary Search
- Ternary Search
- Question: Why is binary search preferred over ternary search?
- When dividing an array by k ( 2(binary) or 3(ternary)), it reduces the array size to 1/k. But it increases the no of comparisons by k.
- Question: Why is binary search preferred over ternary search?
I will be adding more questions soon! If you would like to contribute to the Android Cheat Sheet, just make a pull request!