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

36 questions

  1. 1Koko eating bananas.MediumCoding· Flipkart, Amazon
  2. 2Merge IntervalsMediumCoding· Blinkit, Docquity Holdings(PBS)
  3. 3Top k frequent elementsMediumCoding· Amazon, Apple
  4. 4Product of Array Except SelfMediumCoding· PayPal, Target
  5. 5Course ScheduleMediumCoding· Zoho
  6. 6Given 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
  7. 7Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  8. 8Count items within compartments between specific indices of an array.MediumCoding· Amazon
  9. 9Find the first missing positive number in an array.HardCoding· Amazon
  10. 10Implement file searchMediumCoding· Amazon
  11. 11Implement a phrase search in a list of documents.MediumCoding· Amazon, Confluent
  12. 12Implement LRU Cache.HardCoding· Accenture, Adobe
  13. 13Find the maximum product of any two integers in an array.MediumCoding· Amazon
  14. 14Most Common WordsEasyCoding· Amazon
  15. 15Move all zeros to the end of an array.EasyCoding· Adobe, Amazon
  16. 16How do you split a machine learning dataset for training, evaluation, and testing?MediumCoding· Amazon
  17. 17Get the top API users based on transaction logs.MediumCoding· Amazon
  18. 18Print the top view of nodes in a binary tree.MediumCoding· Amazon
  19. 19Calculate the trapped rainwater between bars in a given array.HardCoding· Adobe, Amazon
  20. 20Find all permutations of a given string.MediumCoding· Amazon
  21. 21Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon
  22. 22Detect cycle in graphMediumCoding· Amazon
  23. 23How can you tell if a graph is not a tree?MediumCodingTechnical· Amazon
  24. 24Edit distanceHardCoding· Adobe, Amazon