Awesome
Android-Cheat-sheet
Cheat Sheet for Android Interviews. Updated the list to include the latest android components available in 2024.
Topics
- 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) </br>
Common Coding Programs
-
<b>Arrays</b></br>
- 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 </br>
-
<b>Dynamic Programming</b></br>
-
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
-
Given coin denominations and the total amount, find out the number of ways to make the change
</br>
-
<b>Queues</b></br>
-
<b>LinkedList</b></br>
- </br>
-
<b>Stacks</b></br>
-
<b>Back Tracking</b></br>
-
<b>Graphs</b></br>
-
<b>Trees</b></br>
- 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 </br>
-
<b>Strings</b></br>
-
<b>Integers</b></br>
-
<b>Miscellaneous</b></br>
Data Structure Coding Programs
-
<b>Sorting</b></br>
- BubbleSort
- InsertionSort
- SelectionSort
- QuickSort
- MergeSort
- <b>Question: Why is quicksort preferred over merge sort for sorting arrays?</b></br>
- 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.</br>
- <b>Question: Why is merge sort preferred over quicksort for sorting linked lists?</b></br>
-
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.
</br>
-
- <b>Question: Why is quicksort preferred over merge sort for sorting arrays?</b></br>
-
<b>Searching</b></br>
- Binary Search
- Rotated Binary Search
- Ternary Search
- <b>Question: Why is binary search preferred over ternary search?</b></br>
-
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.
</br>
-
- <b>Question: Why is binary search preferred over ternary search?</b></br>
-
<b>Runtime Complexity Table:</b></br> <a href="https://github.com/anitaa1990/Android-Cheat-sheet/blob/master/media/4.png" target="_blank"><img src="https://github.com/anitaa1990/Android-Cheat-sheet/blob/master/media/4.png"></a></br>
I will be adding more questions soon! If you would like to contribute to the Android Cheat Sheet, just make a pull request!