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

51 questions

  1. 25Move all zeros to the end of an array.EasyCoding· Adobe, Amazon
  2. 26Partition an array into two sub-arrays with equal sum.MediumCoding· Apple, LinkedIn
  3. 27Sort a binary array in linear time.EasyCoding· Accenture, Apple
  4. 28Given an integer array nums and an integer k, return true if nums has a subarray of at least two elements whose sum is a multiple of k.HardCoding· Adobe, Apple
  5. 29Sudoku SolverHardCoding· Adobe, Apple
  6. 30Calculate the trapped rainwater between bars in a given array.HardCoding· Adobe, Amazon
  7. 31Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding· Adobe, Apple
  8. 32Calculate the height of a binary tree.EasyCoding· Apple, Google
  9. 33Build a CalculatorMediumCoding· Adobe, Apple
  10. 34Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding· Adobe, Apple
  11. 35Edit distanceHardCoding· Adobe, Amazon
  12. 36Explain the filter function.MediumCoding· Apple
  13. 37Explain the map function.EasyCoding· Apple
  14. 38Explain the sort function.EasyCoding· Apple
  15. 39Find the palindromes.EasyCoding· Amazon, Apple
  16. 40Find peak element in an arrayEasyCoding· Apple
  17. 41Given an array, find the two sum.EasyCoding· Adobe, Amazon
  18. 42Given a string that doesn't fit into a machine's memory, split it at each space and count the number of spaces.MediumCoding· Apple
  19. 43Implement a doubly linked list.MediumCoding· Anduril, Apple
  20. 44Implement a red-black tree.HardCoding· Apple
  21. 45Determine the latency for a hashmap with given data.MediumCoding· Apple
  22. 46Write a function to return all prime numbers up to a given number n.MediumCoding· Adobe, Apple
  23. 47Reverse a SentenceEasyCoding· Adobe, Apple
  24. 48Reverse a linked list.EasyCoding· Adobe, Apple