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

343 questions

  1. 121Subarray Sum Equals KMediumCoding· Amazon
  2. 122Subarray Sums Divisible by KMediumCoding· Amazon
  3. 123Sum of Beauty in the ArrayMediumCoding· ServiceNow
  4. 124Sum of DistancesMediumCoding· Sprinklr
  5. 125Sum of Two IntegersMediumCoding· BloomBerg
  6. 126Sum Root to Leaf NumbersMediumCoding· BitGo, Meta
  7. 127Swapping Nodes in a Linked ListMediumCoding· ServiceNow
  8. 128The k-th Lexicographical String of All Happy Strings of Length nMediumCoding· TSTechMojo Solutions
  9. 129Ugly Number IIIMediumCoding· Media.net
  10. 130Valid SudokuMediumCoding· PayPal
  11. 131Word FrequencyMediumCoding· NetApp
  12. 132Course ScheduleMediumCoding· Zoho
  13. 133Validate IP AddressMediumCoding· Salesforce
  14. 13401 Matrix: find the nearest zero for every cellMediumCoding· Adobe, Oracle
  15. 135Given 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
  16. 136Write 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
  17. 137Given a string with parentheses, write a function that removes the minimum number of characters to balance the parentheses.MediumCoding· Meta
  18. 138Balanced TreeMediumCoding· Spotify, Uber
  19. 139Given 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
  20. 140Given a binary tree, check if each node is the average of all descendantsMediumCoding· Meta
  21. 141Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  22. 142Given the root of a binary tree of integers, return the maximum path sum.MediumCoding· Adobe, Apple
  23. 143Build a hit counter that tracks the number of hits in the last 5 minutes, supporting multiple keys (e.g., “a”, “b”). Then, use this counter to implement a simple rate limiter.MediumCoding· Uber
  24. 144Given a list with response time for each server, calculate how long time it will take to process n requests.MediumCoding· Google