Amazon Topics for Interview Preparation

    Easy Level

  1. How to check if given four points form a square
  2. Check if a string can be obtained by rotating another string 2 places
  3. Find the nearest smaller numbers on left side in an array
  4. Find if two rectangles overlap
  5. Pair with given product | Set 1 (Find if any pair exists)
  6. Position of rightmost set bit
  7. Print all possible strings that can be made by placing spaces
  8. Replace all ‘0’ with ‘5’ in an input Integer
  9. A Boolean Matrix Question
  10. Amazon Interview Experience | Set 315
  11. Array Rotation
  12. Program for array rotation
  13. Build Lowest Number by Removing n digits from a given number
  14. Calculate the angle between hour hand and minute hand
  15. Check if all bits of a number are set
  16. Check if a given Binary Tree is SumTree
  17. Check if a number can be expressed as x^y (x raised to power y)
  18. Check if two trees are Mirror
  19. Converting Decimal Number lying between 1 to 3999 to Roman Numerals
  20. Count 'd' digit positive integers with 0 as a digit
  21. Count number of bits to be flipped to convert A to B
  22. Count number of occurrences (or frequency) in a sorted array
  23. Count all possible groups of size 2 or 3 that have sum as multiple of 3
  24. Count all possible paths from top left to bottom right of a mXn matrix
  25. Count total set bits in all numbers from 1 to n
  26. Count triplets with sum smaller than a given value
  27. Count words that appear exactly two times in an array of words
  28. Dynamic Programming | Set 30 (Dice Throw)
  29. Equilibrium index of an array
  30. Fill array with 1's using minimum iterations of filling neighbors
  31. Find a Fixed Point (Value equal to index) in a given array
  32. Find first and last occurrences of an element in a sorted array
  33. Find four elements that sum to a given value | Set 1 (n^3 solution)
  34. Find the index of first 1 in a sorted array of 0's and 1's
  35. Find minimum difference between any two elements
  36. Count the number of possible triangles
  37. Find the Missing Number
  38. Find the Number Occurring Odd Number of Times
  39. Find two prime numbers with given sum
  40. Find uncommon characters of the two strings
  41. Given a binary tree, print all root-to-leaf paths
  42. An Interesting Method to Generate Binary Numbers from 1 to n
  43. k largest(or smallest) elements in an array | added Min Heap method
  44. Level Order Tree Traversal
  45. Maximum sum such that no two elements are adjacent
  46. Mobile Numeric Keypad Problem
  47. Numbers having Unique (or Distinct) digits
  48. Position of rightmost set bit
  49. Print all nodes that don't have sibling
  50. Queue | Set 2 (Linked List Implementation)
  51. Rearrange positive and negative numbers in O(n) time and O(1) extra space
  52. Remove characters from the first string which are present in the second string
  53. Remove minimum number of characters so that two strings become anagram
  54. Replace all ‘0’ with ‘5’ in an input Integer
  55. Find a pair with maximum product in array of Integers
  56. Reverse an array upto a given position
  57. Run Length Encoding
  58. Square root of an integer
  59. Tiling Problem
  60. Type of array and its maximum element
  61. Find the middle of a given linked list in C and Java
  62. Write a Program to Find the Maximum Depth or Height of a Tree
  63. Write a program to print all permutations of a given string
  64. Write your own atoi()
  65. A Product Array Puzzle
  66. Add two numbers represented by linked lists | Set 1
  67. Backtracking | Set 1 (The Knight's tour problem)
  68. Binary Search Tree | Set 1 (Search and Insertion)
  69. Binary Tree to Binary Search Tree Conversion
  70. Boundary Traversal of binary tree
  71. Breadth First Traversal or BFS for a Graph
  72. Check for balanced parentheses in an expression
  73. Check if a given array contains duplicate elements within k distance from each other
  74. How to check if given four points form a square
  75. Check if a given sequence of moves for a robot is circular or not
  76. Extract Leaves of a Binary Tree in a Doubly Linked List
  77. Convert a given tree to its Sum Tree
  78. Convert array into Zig-Zag fashion
  79. Converting Roman Numerals to Decimal lying between 1 to 3999
  80. Count maximum points on same line
  81. Count number of ways to cover a distance
  82. Count numbers with same first and last digits
  83. Count ways to reach the n'th stair
  84. Count Inversions in an array | Set 1 (Using Merge Sort)
  85. Delete N nodes after M nodes of a linked list
  86. Depth First Traversal or DFS for a Graph
  87. Design a stack that supports getMin() in O(1) time and O(1) extra space
  88. Diameter of a Binary Tree
  89. Difference between sums of odd level and even level nodes of a Binary Tree
  90. Dynamic Programming | Set 10 ( 0-1 Knapsack Problem)
  91. Dynamic Programming | Set 12 (Longest Palindromic Subsequence)
  92. Dynamic Programming | Set 14 (Maximum Sum Increasing Subsequence)
  93. Dynamic Programming | Set 17 (Palindrome Partitioning)
  94. Dynamic Programming | Set 18 (Partition problem)
  95. For each element in 1st array count elements less than or equal to it in 2nd array
  96. Equilibrium index of an array
  97. Evaluation of Expression Tree
  98. Extract maximum numeric value from a given string | Set 1 (General approach)
  99. Find a peak element
  100. Find a sorted subsequence of size 3 in linear time
  101. Find all strings that match specific pattern in a dictionary
  102. Find an equal point in a string of brackets
  103. Find Excel column name from a given column number
  104. Find four elements a, b, c and d in an array such that a+b = c+d
  105. Find height of a special binary tree whose leaf nodes are connected
  106. Find index of an extra element present in one sorted array
  107. Find maximum level sum in Binary Tree
  108. Maximum product of a triplet (subsequnece of size 3) in array
  109. Find the minimum element in a sorted and rotated array
  110. Find minimum number of coins that make a given value
  111. Find next greater number with same set of digits
  112. Find nth Magic Number
  113. Print all possible words from phone digits
  114. Pythagorean Triplet in an array
  115. Find the Rotation Count in Rotated Sorted array
  116. Find subarray with given sum | Set 1 (Nonnegative Numbers)
  117. Find the element before which all the elements are sm
  118. Find the element that appears once
  119. Find the largest subarray with 0 sum
  120. Find the maximum element in an array which is first increasing and then decre
  121. Find the maximum repeating number in O(n) time and O(1) extra space
  122. Find the row with maximum number of 1s
  123. Find the smallest positive number missing from an unsorted array | Set 1
  124. Find the smallest positive number missing from an unsorted array
  125. Find the smallest window in a string containing all characters of another strin
  126. Find top k (or most frequent) numbers in a stream
  127. Find the transition point in a binary array
  128. Find the two non-repeating elements in an array of repeating elements
  129. Find zeroes to be flipped so that number of consecutive 1's is maximized
  130. Floor in a Sorted Array
  131. Function to check if a singly linked list is palindrome
  132. Find Next Sparse Number
  133. Generate n-bit Gray Codes
  134. Given a string, find its first non-repeating character
  135. Given a binary string, count number of substrings that start and end with 1.
  136. Given only a pointer/reference to a node to be deleted in a singly lin
  137. Given two unsorted arrays, find all pairs whose sum is x
  138. Greedy Algorithms | Set 1 (Activity Selection Problem)
  139. Highest power of 2 less than or equal to given number
  140. How to determine if a binary tree is height-balanced?
  141. Sort a linked list that is sorted alternating ascending and descending orde
  142. Implement Stack using Queues
  143. Intersection of two Sorted Linked Lists
  144. Largest subarray with equal number of 0s and 1s
  145. Length of the longest substring without repeating characters
  146. Level order traversal in spiral form
  147. Longest consecutive sequence in Binary tree
  148. Look-and-Say Sequence
  149. Lowest Common Ancestor in a Binary Tree | Set 1
  150. Lowest Common Ancestor in a Binary Search Tree.
  151. Majority Element
  152. Maximize number of 0s by flipping a subarray
  153. Maximize value of (arr[i] - i) - (arr[j] - j) in an array
  154. Maximum Product Subarray
  155. Maximum sum of i*arr[i] among all rotations of a given array
  156. Maximum sum of lengths of non-overlapping subarrays with k as the max element.
  157. Maximum Sum Path in Two Arrays
  158. Maximum sum such that no two elements are adjacent
  159. Median of two sorted arrays
  160. Merge two sorted linked lists
  161. Minimum sum of squares of character counts in a given string after removing k character
  162. Minimum time required to rot all oranges
  163. Modify contents of Linked List
  164. Move all zeroes to end of array
  165. Multiply two numbers represented by Linked Lists
  166. Next Greater Element
  167. Find n'th node from the end of a Linked List
  168. Program for n'th node from the end of a Linked List
  169. Number of buildings facing the sun
  170. Number of Groups of Sizes Two Or Three Divisible By 3
  171. Number of paths with exactly k coins
  172. Pairwise swap elements of a given linked list
  173. Print all Jumping Numbers smaller than or equal to a given value
  174. Print a Binary Tree in Vertical Order | Set 1
  175. Print Common Nodes in Two Binary Search Trees
  176. Print K'th element in spiral form of matrix
  177. Print Left View of a Binary Tree
  178. Print level order traversal line by line
  179. Print nodes at k distance from root
  180. Print all nodes in a binary tree having K leaves
  181. Print all possible strings that can be made by placing spaces
  182. Print Right View of a Binary Tree
  183. Print unique rows in a given boolean matrix
  184. Implement Queue using Stacks
  185. Rearrange a linked list such that all even and odd positioned nodes are togethe
  186. Rearrange characters in a string such that no two adjacent are same
  187. Remove every k-th node of the linked list
  188. Replace every element with the greatest element on right side
  189. Reverse Level Order Traversal
  190. Reverse words in a given string
  191. Root to leaf path sum equal to a given number
  192. Search an element in a sorted and rotated array
  193. Segregate even and odd nodes in a Linked List
  194. Serialize and Deserialize a Binary Tree
  195. Sliding Window Maximum (Maximum of all subarrays of size k)
  196. Sort a linked list of 0s, 1s and 2s
  197. Sort a stack using recursion
  198. Sort an array of 0s, 1s and 2s
  199. Sort linked list which is already sorted on absolute values
  200. Sorted Array to Balanced BST
  201. Sorted insert for circular linked list
  202. Stock Buy Sell to Maximize Profit
  203. Submatrix Sum Queries
  204. The Celebrity Problem
  205. Trapping Rain Water
  206. Tree Isomorphism Problem
  207. Two elements whose sum is closest to zero
  208. Unbounded Knapsack (Repetition of items allowed)
  209. Union and Intersection of two Linked Lists
  210. Write a program function to detect loop in a linked list
  211. Given an a
  212. Write an Efficient C Program to Reverse Bits of a Number
  213. Write Code to Determine if Two Trees are Identical
  214. XOR of all subarray XORs

Medium Level

  1. A program to check if a binary tree is BST or not
  2. Add all greater values to every node in a given BST
  3. Adding two polynomials using Linked List
  4. Backtracking | Set 6 (Hamiltonian Cycle)
  5. Backtracking | Set 7 (Sudoku)
  6. Backtracking | Set 2 (Rat in a Maze)
  7. Binary Heap
  8. Binary Search Tree | Set 2 (Delete)
  9. Boggle | Set 2 (Using Trie)
  10. Bottom View of a Binary Tree
  11. How to print maximum number of 'A' using given four keys
  12. Clone a Binary Tree with Random Pointers
  13. Clone a linked list with next and random pointer | Set 2
  14. Combinational Sum
  15. Connect n ropes with minimum cost
  16. Connect nodes at same level
  17. Construct Binary Tree from given Parent Array representation
  18. Construct a special tree from given preorder traversal
  19. Program to convert a given number to words
  20. Count of n digit numbers whose sum of digits equals to given sum
  21. Count Possible Decodings of a given Digit Sequence
  22. Count ways to reach the n'th stair
  23. Delete nodes which have a greater value on right side
  24. Delete all occurrences of a given key in a linked list
  25. Detect and Remove Loop in a Linked List
  26. Detect Cycle in a Directed Graph
  27. Detect cycle in an undirected graph
  28. Diagonal Traversal of Binary Tree
  29. Dynamic Programming | Set 11 (Egg Dropping Puzzle)
  30. Dynamic Programming | Set 20 (Maximum Length Chain of Pairs)
  31. Dynamic Programming | Set 22 (Box Stacking Problem)
  32. Dynamic Programming | Set 27 (Maximum sum rectangle in a 2D matrix)
  33. Dynamic Programming | Set 28 (Minimum insertions to form a palindrome)
  34. Dynamic Programming | Set 3 (Longest Increasing Subsequence)
  35. Dynamic Programming | Set 31 (Optimal Strategy for a Game)
  36. Dynamic Programming | Set 4 (Longest Common Subsequence)
  37. Dynamic Programming | Set 5 (Edit Distance)
  38. Find a pair with given sum in a Balanced BST
  39. Find the first circular tour that visits all petrol pumps
  40. Find a triplet that sum to a given value
  41. Find distance between two given keys of a Binary Tree
  42. Find all distinct subsets of a given set
  43. Find the first non-repeating character from a stream of characters
  44. Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
  45. Find if a given string can be represented from a substring by iterating the substring “n
  46. Find k-th smallest element in BST (Order Statistics in BST)
  47. Find length of the largest region in Boolean Matrix
  48. Find next greater number with same set of digits
  49. Find the number of islands | Set 1 (Using DFS)
  50. Find smallest range containing elements from k lists
  51. Find the largest BST subtree in a given Binary Tree | Set 1
  52. Find the largest BST subtree in a given Binary Tree
  53. Program to find amount of water in a given glass
  54. Find whether there is path between two cells in matrix
  55. Flattening a Linked List
  56. Form minimum number from given sequence
  57. Given a number, find the next smallest palindrome
  58. Given a binary string, count number of substrings that start and end with 1.
  59. Construct Complete Binary Tree from its Linked List Representation
  60. Greedy Algorithms | Set 3 (Huffman Coding)
  61. Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST))
  62. How to print maximum number of A's using given four keys
  63. Inorder Successor in Binary Search Tree
  64. Inplace rotate square matrix by 90 degrees | Set 1
  65. Kth smallest element in a row-wise and column-wise sorted 2D array | Set 1
  66. Largest Rectangular Area in a Histogram | Set 2
  67. Largest Sum Contiguous Subarray
  68. Length of the longest substring without repeating characters
  69. Longest Consecutive Subsequence
  70. Maximum difference between node and its ancestor in Binary Tree
  71. Maximum size rectangle binary sub-matrix with all 1s
  72. Maximum size square sub-matrix with all 1s
  73. Merge K sorted linked lists
  74. Merge two BSTs with limited extra space
  75. Merge Overlapping Intervals
  76. Minimum number of jumps to reach end
  77. Minimum Number of Platforms Required for a Railway/Bus Station
  78. Minimum steps to reach a destination
  79. Non-crossing lines to connect points in a circle
  80. Number of non-negative integral solutions of a + b + c = n
  81. Number of subsequences of the form a^i b^j c^k
  82. Nuts & Bolts Problem (Lock & Key problem)
  83. Print extreme nodes of each level of Binary Tree in alternate order
  84. Print all k-sum paths in a binary tree
  85. Print leftmost and rightmost nodes of a Binary Tree
  86. Print Nodes in Top View of Binary Tree
  87. Printing brackets in Matrix Chain Multiplication Problem
  88. Rearrange characters in a string such that no two adjacent are same
  89. Remove minimum elements from either side such that 2*min becomes more than max
  90. Segment Tree | Set 1 (Sum of given range)
  91. Smallest window that contains all characters of string itself
  92. Snake and Ladder Problem
  93. Sort an array according to the order defined by another array
  94. Sort an array in wave form
  95. Stepping Numbers
  96. Topological Sorting
  97. Total number of possible Binary Search Trees with n keys
  98. Trapping Rain Water
  99. Validity of a given Tic-Tac-Toe board configuration
  100. wildcard pattern matching
  101. Given an a
  102. Write a function to get the intersection point of two Linked Lists.
  103. Write an Efficient Method to Check if a Number is Multiple of 3

Hard Level

  1. AVL Tree | Set 1 (Insertion)
  2. AVL Tree | Set 2 (Deletion)
  3. Backtracking | Set 3 (N Queen Problem)
  4. Backtracking | Set 7 (Sudoku)
  5. Construct a Binary Tree from Postorder and Inorder
  6. Dynamic Programming | Set 37 (Boolean Parenthesization Problem)
  7. Find Recurring Sequence in a Fraction
  8. Find maximum of minimum for every window size in a given array
  9. Two nodes of a BST are swapped, correct the BST
  10. Given an array arr[], find the maximum j - i such that arr[j] > arr[i]
  11. Arrange given numbers to form the biggest number | Set 1
  12. Arrange given numbers to form the biggest number
  13. Given a sorted dictionary of an alien language, find order of characters
  14. Implement LRU Cache
  15. Median in a stream of integers (running integers)
  16. Partition a set into two subsets such that the difference of subset sums is
  17. Rearrange a given linked list in-place.

Company Wise Coding Practice    Topic Wise Coding Practice