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.

You can also take part in our mock placement contests which will help you learn different topics and practice at the same time, simulating the feeling of a real placement test environment.

Note : Now you can track your progress of these questions Must Do Interview Preparation Course.

Topic :

Arrays :



  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

Solved the above? Go for some more Questions

String :

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

Solved the above? Go for some more Questions

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

Solved the above? Go for some more Questions

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

Important Links :

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

Sudo Placement 2019

Sudo Placement is back to help you this placement season. Prepare for the Recruitment drive of product-based companies like Microsoft, Amazon, Adobe, etc with our free online placement preparation course.

Register Online

Geeks Classes in Noida : Offline Course

If you are in NCR region of India, you may join Geeks Classes program.

Register for Offline

You may also check our latest online course series to learn DS & Algo is named DSA, which covers everything about Data Structures from Basic to Advanced.

This is a 10 weeks long online certification program specializing in Data Structures & Algorithms which includes pre-recorded premium Video lectures & programming questions for practice. You will learn algorithmic techniques for solving various computational problems and will implement more than 200 algorithmic coding problems. This course offers you a wealth of programming challenges that you may face at your next job interview. The course focuses mainly on Data Structure & Algorithms: the key to selection in top product based companies.

Key Features of the Course

  • Well organised tutorials on Data-Structures and Algorithms prepared by the GeeksforGeeks Team.
  • Premium video lectures by Mr. Sandeep Jain, Founder and C.E.O of GeeksforGeeks.
  • Dedicated doubt solving team to assist you.
  • Weekly Assessment Tests with Video Solutions.
  • Performance-Based Certificate.
  • Internship Opportunities at GeeksforGeeks.
  • The courses are self-paced: Anyone can register anytime, make payment and begin the course.
  • And, many more.

The course is available in two versions:

  1. With Doubt Assistance: The price of the self-paced online DSA course with doubt assistance is INR 3,999. Click here to purchase your ticket.
  2. Without Doubt Assistance: The price of the self-paced online DSA course without doubt assistance is INR 2,499. Click here to purchase your ticket

    .
  3. More Paid Courses

    • SDE Test Series:

      The test series is designed to help you build concepts, prepare strategies, identify weaknesses, and take steps to eliminate them. The test series simulate several variations that a job interview could come up with and thereby, through the practice provided, help students develop accuracy and speed for the interview

      We feel that this is the vital aspect that enables a student to perform well when they appear for a job in top product-based companies. A test series is also a tool that helps the student to evaluate performance over a while and improve accordingly. The detailed test analysis is an invaluable part of preparation which any serious candidate would vouch for.

      In this course, the contest problem solutions are available in the video mode & at the discussion forum, you may discuss the problems with the team of problem setter. Further, the tests will be available every week. According to your time convenience, you may attempt that contest at any time in that week.

    • Geeks Classes – Live Session:

      An extensive Online (live) classroom program to build and enhance Data Structures and Algorithm concepts. The course is designed to improve your problem-solving and coding skills by enhancing your understanding of Data Structures & Algorithms. The primary goal of this course is to help you in the preparation for the Coding interviews of companies like Amazon, Microsoft, Uber, etc.

      It will be an online live (Live Stream) class, so you can attend this class from any geographical location. It will be an interactive live session, where you can ask your doubts to the instructor (similar to offline classroom program).


    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



    My Personal Notes arrow_drop_up