Skip to main content

List of Most asked Questions by Amazon


       


 


Questions in Array - 

  1. Subarray with given sum
  2. Count the triplets
  3. Kadane’s Algorithm
  4. Missing number in array
  5. Merge two sorted arrays
  6. Rearrange array alternatively
  7. Number of pairs
  8. Inversion of Array
  9. Sort an array of 0s, 1s and 2s
  10. Equilibrium point
  11. Leaders in an array
  12. Minimum Platforms
  13. Reverse array in groups
  14. K’th smallest element
  15. Trapping Rain Water
  16. Pythagorean Triplet
  17. Chocolate Distribution Problem
  18. Stock buy and sell
  19. Element with left side smaller and right side greater
  20. Convert array into Zig-Zag fashion
  21. Last Index of 1
  22. Spirally traversing a matrix
  23. Largest Number formed from an Array

                                                            String - 


Linked List :

  1. Finding middle element in a linked list
  2. Reverse a linked list
  3. Rotate a Linked List
  4. Reverse a Linked List in groups of given size
  5. Intersection point in Y shaped linked lists
  6. Detect Loop in linked list
  7. Remove loop in Linked List
  8. n’th node from end of linked list
  9. Flattening a Linked List
  10. Merge two sorted linked lists
  11. Intersection point of two Linked Lists
  12. Pairwise swap of a linked list
  13. Add two numbers represented by linked lists
  14. Check if Linked List is Palindrome
  15. Implement Queue using Linked List
  16. Implement Stack using Linked List
  17. Given a linked list of 0s, 1s and 2s, sort it
  18. Delete without head pointer

Stack and Queue :

  1. Parenthesis Checker
  2. Next larger element
  3. Queue using two Stacks
  4. Stack using two queues
  5. Get minimum element from stack
  6. LRU Cache
  7. Circular tour
  8. First non-repeating character in a stream
  9. Rotten Oranges
  10. Maximum of all subarrays of size k

Tree :

  1. Print Left View of Binary Tree
  2. Check for BST
  3. Print Bottom View of Binary Tree
  4. Print a Binary Tree in Vertical Order
  5. Level order traversal in spiral form
  6. Connect Nodes at Same Level
  7. Lowest Common Ancestor in a BST
  8. Convert a given Binary Tree to Doubly Linked List
  9. Write Code to Determine if Two Trees are Identical or Not
  10. Given a binary tree, check whether it is a mirror of itself
  11. Height of Binary Tree
  12. Maximum Path Sum
  13. Diameter of a Binary Tree
  14. Number of leaf nodes
  15. Check if given Binary Tree is Height Balanced or Not
  16. Serialize and Deserialize a Binary Tree

Heap :

  1. Find median in a stream
  2. Heap Sort
  3. Operations on Binary Min Heap
  4. Rearrange characters
  5. Kth largest element in a stream
  6. Merge K sorted linked lists
  7. Kth largest element in a stream

Recursion :

  1. Flood fill Algorithm
  2. Number of paths
  3. Combination Sum – Part 2
  4. Special Keyboard
  5. Josephus problem

Hashing :

  1. Relative Sorting
  2. Sorting Elements of an Array by Frequency
  3. Largest subarray with 0 sum
  4. Common elements
  5. Find all four sum numbers
  6. Swapping pairs make sum equal
  7. Count distinct elements in every window
  8. Array Pair Sum Divisibility Problem
  9. Longest consecutive subsequence
  10. Array Subset of another array
  11. Find all pairs with a given sum
  12. Find first repeated character
  13. Zero Sum Subarrays
  14. Minimum indexed character
  15. Check if two arrays are equal or not
  16. Uncommon characters
  17. Smallest window in a string containing all the characters of another string
  18. First element to occur k times
  19. Check if frequencies can be equal

Graph :

  1. Depth First Traversal
  2. Breadth First Traversal
  3. Detect cycle in undirected graph
  4. Detect cycle in a directed graph
  5. Topological sort
  6. Find the number of islands
  7. Implementing Dijkstra
  8. Minimum Swaps
  9. Strongly Connected Components
  10. Shortest Source to Destination Path
  11. Find whether path exist
  12. Minimum Cost Path
  13. Circle of Strings
  14. Floyd Warshall
  15. Alien Dictionary
  16. Snake and Ladder Problem

Greedy :

  1. Activity Selection
  2. N meetings in one room
  3. Coin Piles
  4. Maximize Toys
  5. Page Faults in LRU
  6. Largest number possible
  7. Minimize the heights
  8. Minimize the sum of product
  9. Huffman Decoding
  10. Minimum Spanning Tree
  11. Shop in Candy Store
  12. Geek collects the balls

Dynamic Programming :

  1. Minimum Operations
  2. Max length chain
  3. Minimum number of Coins
  4. Longest Common Substring
  5. Longest Increasing Subsequence
  6. Longest Common Subsequence
  7. 0 – 1 Knapsack Problem
  8. Maximum sum increasing subsequence
  9. Minimum number of jumps
  10. Edit Distance
  11. Coin Change Problem
  12. Subset Sum Problem
  13. Box Stacking
  14. Rod Cutting
  15. Path in Matrix
  16. Minimum sum partition
  17. Count number of ways to cover a distance
  18. Egg Dropping Puzzle
  19. Optimal Strategy for a Game
  20. Shortest Common Supersequence

Divide and Conquer :

  1. Find the element that appears once in sorted array
  2. Search in a Rotated Array
  3. Binary Search
  4. Sum of Middle Elements of two sorted arrays
  5. Quick Sort
  6. Merge Sort
  7. K-th element of two sorted Arrays

Backtracking :

  1. N-Queen Problem
  2. Solve the Sudoku
  3. Rat in a Maze Problem
  4. Word Boggle
  5. Generate IP Addresses

Bit Magic :

  1. Find first set bit
  2. Rightmost different bit
  3. Check whether K-th bit is set or not
  4. Toggle bits given range
  5. Set kth bit
  6. Power of 2
  7. Bit Difference
  8. Rotate Bits
  9. Swap all odd and even bits
  10. Count total set bits
  11. Longest Consecutive 1’s
  12. Sparse Number
  13. Alone in a couple
  14. Maximum subset XOR

Some More Questions on Arrays :

  1. Find Missing And Repeating
  2. Maximum Index
  3. Consecutive 1’s not allowed
  4. Majority Element
  5. Two numbers with sum closest to zero
  6. Nuts and Bolts Problem
  7. Boolean Matrix Problem
  8. Smallest Positive missing number
  9. Jumping Caterpillars

Some More Questions on Strings :

  1. Most frequent word in an array of strings
  2. CamelCase Pattern Matching
  3. String Ignorance
  4. Smallest window in a string containing all the characters of another string
  5. Design a tiny URL or URL shortener
  6. Permutations of a given string
  7. Non Repeating Character
  8. Check if strings are rotations of each other or not
  9. Save Ironman
  10. Repeated Character
  11. Remove common characters and concatenate
  12. Geek and its Colored Strings
  13. Second most repeated string in a sequence

Some more Questions on Trees :

  1. Mirror Tree
  2. Longest consecutive sequence in Binary tree
  3. Bottom View of Binary Tree
  4. Lowest Common Ancestor in a Binary Tree
  5. Binary to DLL

Comments

Popular posts from this blog

List of Questions asked by Morgan Stanley

  Coding Questions -  1.  .   Exchange kth node from start and kth node from end of a singly linked list. 2.    Given a number, you have to find next greater number which has same set of digits. 3.    Given a binary tree, you have to print level order traversal of the tree (left child then right child) but every next level has to be printed in next line. 4.    Longest Common Substring 5.    Spiral level order traversal 6.    Add two linked lists 7.    Write a function to find the mirror image of binary tree 8.    WAP to find the character which occurred maximum times in the character array 9.  Given a 2d matrix find an element in a matrix which is 0 and make the entire row and column to 0 10.  Find the minimum element in the rotated array of integers 11.  Find highest length substring such that there are equal number of 0’s and 1’sin array of 1’s and 0’s only 12.  Given a dictio...

Top Questions asked by Facebook

                  Facebook is the dream company of almost every software engineer. If you are doing interview preparation, you can't skip the must do coding questions for Facebook. Facebook is the product-based company and tests the candidate on data structures and algorithms, and logical questions. The coding level is a bit tough, but you can do it with your hard work. Below is the list of coding questions you must prepare before sitting for Facebook. Smallest string which not a subsequence of the given string Maximum length possible by cutting N given woods into at least K pieces Count possible decodings of a given Digit Sequence | Set 2 Find the maximum path sum in a binary tree   Maximize profit for buying and selling stock given a series of price vectors Given  m  sorted arrays, find the  k- th smallest value Binary search in a sorted, rotated array Given a string, check if it is a palindrome  by ignoring spaces....

Which is best: LeetCode vs HackerEarth ?

  Well, all the platforms almost are same except the interface. That's what I think. To conclude the result, let's compare them through the features they offer.  Features of Leetcode -  Topic - wise questions Comapny-wise questions Weekly contests Interview Preparation section Discuss section Features of HackerEarth Topic-wise problems Monthly contests Discuss section Hiring Contests Hackathons Earlier, when I started coding in my first year. I was fond of HackerEarth. But when I stoped using hackerearth and shifted to Leetcode, I like it more. It depends upon how much comfortable you are with the interface. But, it can't be denied that Leetcode offer more than HackerEarth. But for the coders who love hackathons, HackerEarth is best for them and for the people looking out for job opportunities. Do share your favorite through comments!