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

57 questions

  1. 25Valid AnagramCoding· Adobe
  2. 2601 Matrix: find the nearest zero for every cellMediumCoding· Adobe, Oracle
  3. 27Given the root of a binary tree of integers, return the maximum path sum.MediumCoding· Adobe, Apple
  4. 28Build a Basic Regex ParserHardCoding· Adobe, Apple
  5. 29Print all combinations of numbers from 1 to n that sum to n.MediumCoding· Adobe, Apple
  6. 30Cycle Detection in Package Manager.MediumCoding· Adobe
  7. 31Explain how to find a target sum in an array.MediumCoding· Adobe, Google
  8. 32Find the DuplicatesEasyCoding· Adobe, Apple
  9. 33Find a triplet in an array with a given sum.MediumCoding· Adobe, Goldman Sachs
  10. 34Generate ParenthesesMediumCoding· Adobe, Google
  11. 35Given 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
  12. 36PermutationsMediumCoding· Adobe, Apple
  13. 37Find the longest palindromic subsequence using dynamic programming.MediumCoding· Adobe, Apple
  14. 38Implement LRU Cache.HardCoding· Accenture, Adobe
  15. 39Find the maximum subarray sum.MediumCoding· Adobe, Apple
  16. 40Merge k sorted linked lists.HardCoding· Adobe, Apple
  17. 41Move all zeros to the end of an array.EasyCoding· Adobe, Amazon
  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. 46Build a CalculatorMediumCoding· Adobe, Apple
  23. 47Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding· Adobe, Apple
  24. 48Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon