Must Do Coding Questions for Companies like Amazon, Microsoft, Adobe, …

As the placement season is back so are we to help you ace the interview. We have selected some most commonly asked and must do practice problems for you. We recommend to practice these and ace the coding round with confidence. Happy Coding.

Topic :

Arrays :

  1. Kadane’s Algorithm
  2. Missing number in array
  3. Subarray with given sum
  4. Sort an array of 0s, 1s and 2s
  5. Equilibrium point
  6. Maximum sum increasing subsequence
  7. Leaders in an array
  8. Minimum Platforms
  9. Maximum of all subarrays of size k
  10. Reverse array in groups
  11. K’th smallest element
  12. Trapping Rain Water
  13. Pythagorean Triplet
  14. Chocolate Distribution Problem
  15. Stock buy and sell
  16. Element with left side smaller and right side greater
  17. Convert array into Zig-Zag fashion
  18. Find the element that appears once in sorted array
  19. Kth largest element in a stream
  20. Relative Sorting
  21. Spirally traversing a matrix
  22. Sorting Elements of an Array by Frequency
  23. Largest Number formed from an Array

String :

  1. Parenthesis Checker
  2. Reverse words in a given string
  3. Permutations of a given string
  4. Longest Palindrome in a String
  5. Recursively remove all adjacent duplicates
  6. Check if string is rotated by two places
  7. Roman Number to Integer
  8. Anagram
  9. Longest Common Substring
  10. Remove Duplicates
  11. Form a Palindrome
  12. Longest Distinct Characters in the string
  13. Implement Atoi
  14. Implement strstr
  15. Longest Common Prefix

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. Detect Loop in linked list
  6. Remove loop in Linked List
  7. n’th node from end of linked list
  8. Flattening a Linked List
  9. Merge two sorted linked lists
  10. Intersection point of two Linked Lists
  11. Pairwise swap of a linked list
  12. Add two numbers represented by linked lists
  13. Check if Linked List is Palindrome
  14. Implement Queue using Linked List
  15. Implement Stack using Linked List
  16. Given a linked list of 0s, 1s and 2s, sort it
  17. Delete without head pointer

Stack and Queue :

  1. Next larger element
  2. Queue using two Stacks
  3. Stack using two queues
  4. Get minimum element from stack
  5. LRU Cache
  6. Circular tour
  7. First non-repeating character in a stream
  8. Rotten Oranges

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

Recursion :

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

Hashing :

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

Graph :

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

Greedy :

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

Dynamic Programming :

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

Divide and Conquer :

  1. Binary Search
  2. Quick Sort
  3. Merge Sort
  4. Find the element that appears once in sorted array
  5. K-th element of two sorted Arrays
  6. Last index of One

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

Important Links :

  1. Aptitude questions asked in round 1 : Placements Course designed for this purpose.
  2. MCQs asked from different computer science subjects : Subject-Wise Quizzes
  3. Interview theory and coding questions of all companies : Company wise all practice questions.
  4. Interview experiences of all companies : Interview corner.

If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

GATE CS Corner    Company Wise Coding Practice

Recommended Posts:







Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.