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. 1Koko eating bananas.MediumCoding· Flipkart, Amazon
  2. 2Merge IntervalsMediumCoding· Blinkit, Docquity Holdings(PBS)
  3. 3Top k frequent elementsMediumCoding· Amazon, Apple
  4. 4Group anagramsMediumCoding· Blinkit, MakeMyTrip
  5. 5Product of Array Except SelfMediumCoding· PayPal, Target
  6. 6Sort a K-Messed ArrayMediumCoding· Meta
  7. 7Course ScheduleMediumCoding· Zoho
  8. 8Validate IP AddressMediumCoding· Salesforce
  9. 901 Matrix: find the nearest zero for every cellMediumCoding· Adobe, Oracle
  10. 10Given a list of car rental requests with start and end times, assign cars to rentals such that the total number of cars used is minimized.MediumCoding· Google
  11. 11Write a function to balance parentheses in a given string by removing the fewest characters possible. Ensure that each opening parenthesis has a corresponding closing parenthesis and each pair is properly nested.MediumCoding· Meta
  12. 12Given a string with parentheses, write a function that removes the minimum number of characters to balance the parentheses.MediumCoding· Meta
  13. 13Balanced TreeMediumCoding· Spotify, Uber
  14. 14Given 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
  15. 15Given a binary tree, check if each node is the average of all descendantsMediumCoding· Meta
  16. 16Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  17. 17Given the root of a binary tree of integers, return the maximum path sum.MediumCoding· Adobe, Apple
  18. 18Given a castle with rooms named after flowers where each room has an instruction to the next room, write an algorithm to find the rooms containing treasure.MediumCoding· PayPal
  19. 19Given a collection of rooms where Alibada is in one and moves one room a day to an adjacent room, write a program to determine if you can find Alibada with the given list of rooms.MediumCoding· Meta
  20. 20Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding· Meta, Microsoft
  21. 21Given two empty jugs with capacities a and b liters and an infinite water supply, determine a way to end up with exactly X liters of water.MediumCoding· Microsoft
  22. 22Print all combinations of numbers from 1 to n that sum to n.MediumCoding· Adobe, Apple
  23. 23Find the container with the maximum volume of water.MediumCoding· Apple, Goldman Sachs
  24. 24Count items within compartments between specific indices of an array.MediumCoding· Amazon