Question bank

4,310 interview questions, answered.

Reference answers, what the interviewer is really testing, how it is graded, and the follow-ups that come next.

Easy 190Medium 2,498Hard 982
Filters · onDifficulty, topic, company

205 questions

  1. 145Find peak element in an arrayEasyCoding· Apple
  2. 146Given a binary matrix with every row sorted, find the index of the row containing the most number of 1s.MediumCoding· Amazon
  3. 147Find the shortest path in a graph.MediumCodingTechnical· Amazon
  4. 148Given an array of task durations (in minutes), return the pairs of tasks that can be completed within 60 minutes. For example, for [1, 43, 20, 59, 30, 30], return [[0, 3], [4, 5]].MediumCoding· DoorDash
  5. 149Given an array of integers, find a tuple of three integers that can form a triangle.MediumCoding· LinkedIn
  6. 150Given an array, find the two sum.EasyCoding· Adobe, Amazon
  7. 151Given two strings of equal length, determine if it's possible to form a palindrome by cutting them in half.EasyCoding· Google
  8. 152Implement a function to justify a list of words within a given width.MediumCoding· Google, Microsoft
  9. 153Given a string that doesn't fit into a machine's memory, split it at each space and count the number of spaces.MediumCoding· Apple
  10. 154Given an array representing the height of buildings from a sea beach, return an array of heights of the buildings that have a sea view.MediumCoding· Meta
  11. 155Implement a doubly linked list.MediumCoding· Anduril, Apple
  12. 156Implement a red-black tree.HardCoding· Apple
  13. 157Given a list of jobs and a list of dependencies where each job depends on another job being completed first, determine if it is possible to complete all jobs.MediumCoding· Oracle
  14. 158Determine the latency for a hashmap with given data.MediumCoding· Apple
  15. 159Find the longest common prefix given two integer arrays.MediumCoding· Amazon
  16. 160Given 2 strings, return the longest common substring.MediumCoding· Salesforce
  17. 161Given an array of n integers and a number k, find the maximum number of elements whose sum is less than k, and return their sum.MediumCoding· Goldman Sachs
  18. 162Print the maximum positive sequence in a given array.MediumCoding· Amazon
  19. 163Given a binary array where an operation cycles a row's elements to the left or right, return the minimum number of operations needed to create a column of 1s. If not possible, return 0.MediumCoding· Palantir
  20. 164Given positions of N kids and M ice cream sellers on a 1D line, find the smallest distance E such that every kid lies within the range [P - E, P + E] of at least one seller.MediumCoding· Google
  21. 165Implement inorder traversal for an N-ary tree.MediumCoding· Amazon
  22. 166Given an array, print the Next Greater Element (NGE) for each element. The NGE for an element x is the first greater element on the right side of x in the array, or -1 if none exists.MediumCoding· Amazon
  23. 167Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding· Adobe, Amazon
  24. 168Determine if a number is a power of two.MediumCoding· Salesforce