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

1,063 questions

  1. 913Explain the sort function.EasyCoding· Apple
  2. 914Given a factory represented as a 2D grid with some cells blocked and some containing robots, determine if the robots can collectively reach all unblocked cells.MediumCoding· Amazon
  3. 915Fibonacci NumbersEasyCoding· Adobe, Google
  4. 916Find the closest palindrome of a given number.MediumCoding· Uber
  5. 917Find duplicate files in a file system.MediumCodingTechnical· Anthropic, Dropbox
  6. 918Find the element at a given position in a sorted version of an unsorted array. Example: Input: {5,1,7,19,0,16}, k=3 Output: 5 (Explanation: Sorted array is {0,1,5,7,16,19}, and the 3rd positioned element is 5.)MediumCodingTechnical· Philips
  7. 919Given an array of points and a point P, find the k closest points to P.MediumCoding· Amazon, LinkedIn
  8. 920Find Largest NumbersMediumCoding· Accenture, Goldman Sachs
  9. 921Given a list of Nodes, each with a unique string id and a list of subnodes it depends on, find the maximum depth of the dependencies.MediumCoding· Amazon
  10. 922Given an array 'nums' with n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.EasyCoding· Accenture
  11. 923Find Monthly Revenue GrowthHardCodingData· Uber
  12. 924Find the number of rotations in a circularly sorted array.MediumCoding· AMD, Microsoft
  13. 925Find the palindromes.EasyCoding· Amazon, Apple
  14. 926Find peak element in an arrayEasyCoding· Apple
  15. 927Given a binary matrix with every row sorted, find the index of the row containing the most number of 1s.MediumCoding· Amazon
  16. 928Find the shortest path in a graph.MediumCodingTechnical· Amazon
  17. 929Given 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
  18. 930Find the maximum subarray productMediumCoding· LinkedIn
  19. 931Given an array of integers, find a tuple of three integers that can form a triangle.MediumCoding· LinkedIn
  20. 932Given an array, find the two sum.EasyCoding· Adobe, Amazon
  21. 933Given two strings of equal length, determine if it's possible to form a palindrome by cutting them in half.EasyCoding· Google
  22. 934Implement a function to justify a list of words within a given width.MediumCoding· Google, Microsoft
  23. 935Given a string that doesn't fit into a machine's memory, split it at each space and count the number of spaces.MediumCoding· Apple
  24. 936Given 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