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

65 questions

  1. 25Design an indexer and a retrieverMediumCoding· Apple
  2. 26Explain the differences between stack and heap memory allocation.MediumCoding· Apple, Microsoft
  3. 27Given an array with objects colored red, white, or blue, sort them so those of the same color are adjacent. Use integers 0, 1, 2 to represent RWB respectively.MediumCoding· Apple
  4. 28Find the DuplicatesEasyCoding· Adobe, Apple
  5. 29Given n houses in a line with money in each, find the maximum amount a robber can steal, without stealing from two adjacent houses.MediumCoding· Adobe, Apple
  6. 30Implement TrieMediumCoding· Apple, Goldman Sachs
  7. 31PermutationsMediumCoding· Adobe, Apple
  8. 32Find the longest palindromic subsequence using dynamic programming.MediumCoding· Adobe, Apple
  9. 33Find the longest substring without repeating characters.MediumCoding· Apple, Intuit
  10. 34Find the lowest common ancestor (LCA) of two nodes in a binary tree.MediumCoding· Apple, LinkedIn
  11. 35Implement LRU Cache.HardCoding· Accenture, Adobe
  12. 36Maximum Number of Visible PointsMediumCoding· Apple
  13. 37Find the maximum subarray sum.MediumCoding· Adobe, Apple
  14. 38Merge k sorted linked lists.HardCoding· Adobe, Apple
  15. 39Move all zeros to the end of an array.EasyCoding· Adobe, Amazon
  16. 40Partition an array into two sub-arrays with equal sum.MediumCoding· Apple, LinkedIn
  17. 41Sort a binary array in linear time.EasyCoding· Accenture, Apple
  18. 42Given 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
  19. 43Sudoku SolverHardCoding· Adobe, Apple
  20. 44Calculate the trapped rainwater between bars in a given array.HardCoding· Adobe, Amazon
  21. 45Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding· Adobe, Apple
  22. 46Calculate the height of a binary tree.EasyCoding· Apple, Google
  23. 47Build a CalculatorMediumCoding· Adobe, Apple
  24. 48Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding· Adobe, Apple