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

164 questions

  1. 121Tree traversal, BFSCoding· Amazon
  2. 122TreesCoding· Amazon, Infosys
  3. 123Two pointerCoding· Amazon
  4. 124Ugly NumberEasyCoding· Amazon
  5. 125Wildcard matchingCoding· Amazon
  6. 126Course ScheduleMediumCoding· Zoho
  7. 127Given a list of items with different sizes, write an algorithm to pack these items into the minimum number of batches without exceeding the capacity of each batch.MediumCoding· Amazon
  8. 128Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  9. 129Count items within compartments between specific indices of an array.MediumCoding· Amazon
  10. 130Find the first missing positive number in an array.HardCoding· Amazon
  11. 131Implement file searchMediumCoding· Amazon
  12. 132Implement a k-nearest neighbors algorithm.EasyCodingAI ML· Amazon, Pinterest
  13. 133Implement a phrase search in a list of documents.MediumCoding· Amazon, Confluent
  14. 134Implement LRU Cache.HardCoding· Accenture, Adobe
  15. 135Find the maximum product of any two integers in an array.MediumCoding· Amazon
  16. 136Find the maximum possible stability of any subset of servers. Return the result modulo 10^9+7. E.g. Consider set of servers where reliability = [1, 2, 2], availability = [1, 1, 3].MediumCoding· Amazon
  17. 137Most Common WordsEasyCoding· Amazon
  18. 138Move all zeros to the end of an array.EasyCoding· Adobe, Amazon
  19. 139Given a string of parentheses types and an array of their efficiency ratings, write a function to find the most efficient valid parentheses sequence that can be formed. Return its total efficiency score.HardCoding· Amazon
  20. 140Session Data Analysis.HardCodingTechnical· Amazon
  21. 141How do you split a machine learning dataset for training, evaluation, and testing?MediumCoding· Amazon
  22. 142Write a query to find all dates where the stadium had three or more consecutive days with attendance of 100 or more people.HardCodingData· Amazon
  23. 143Write a query to find the top 3 unique salaries in each department and list all employees who have those salaries.MediumCodingData· Amazon
  24. 144Get the top API users based on transaction logs.MediumCoding· Amazon