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

155 questions

  1. 49Find the largest perimeter of an island given a two-dimensional array of 1's and 0's representing land and water.MediumCoding· Bloomberg, Meta
  2. 50PermutationsMediumCoding· Adobe, Apple
  3. 51Lexicographic Grid Travel.MediumCoding· Databricks
  4. 52Given an array of integers and a number N, find the length of the longest contiguous subarray such that the difference between any two elements in the subarray is less than N.MediumCoding· Uber
  5. 53Find the longest palindromic subsequence using dynamic programming.MediumCoding· Adobe, Apple
  6. 54Find the longest substring without repeating characters.MediumCoding· Apple, Intuit
  7. 55Find the lowest common ancestor (LCA) of two nodes in a binary tree.MediumCoding· Apple, LinkedIn
  8. 56A knapsack has a maximum capacity C and there are n items each with weight w[i] and value v[i]. Maximize the knapsack value without exceeding capacity.MediumCodingTechnical· Uber
  9. 57Maximum Number of Visible PointsMediumCoding· Apple
  10. 58Find the maximum product of any two integers in an array.MediumCoding· Amazon
  11. 59Find the maximum subarray sum.MediumCoding· Adobe, Apple
  12. 60Find the minimum characters to insert to make a string a palindrome.MediumCoding· Uber
  13. 61Given a large n-ary tree where the root node can pass information to one child per iteration, and in subsequent iterations, nodes can pass information to one child while the root continues with others, find the minimum number of iterations to reach all nodes.MediumCoding· Google
  14. 62Find the minimum window substring.MediumCoding· Airbnb, Dropbox
  15. 63Partition an array into two sub-arrays with equal sum.MediumCoding· Apple, LinkedIn
  16. 64Print all words from a dictionary that can be found on a given Boggle board.MediumCoding· Microsoft
  17. 65Write functions to serialize and deserialize a list of strings.MediumCoding· Google, Nvidia
  18. 66Sort an array containing only 0s, 1s, and 2s.MediumCodingTechnical· LinkedIn
  19. 67How do you split a machine learning dataset for training, evaluation, and testing?MediumCoding· Amazon
  20. 68Squares of sorted arrayMediumCoding· Meta, PayPal
  21. 69Given a sorted array of integers (which may include negatives), return the squares of the numbers in sorted order. As a follow-up, find the k-th smallest squared value.MediumCoding· Uber
  22. 70How would you store a list of numbers as a single number?MediumCodingTechnical· Atlassian, Microsoft
  23. 71Get the top API users based on transaction logs.MediumCoding· Amazon
  24. 72Print the top view of nodes in a binary tree.MediumCoding· Amazon