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

10 questions

  1. 1Most Profitable Path in a TreeMediumCoding· Uber
  2. 2Strictly Palindromic NumberMediumCoding· Uber
  3. 3Balanced TreeMediumCoding· Spotify, Uber
  4. 4Build 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
  5. 5Design a rewarding system.MediumCoding· Uber
  6. 6Given 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
  7. 7A 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
  8. 8Find the minimum characters to insert to make a string a palindrome.MediumCoding· Uber
  9. 9Given 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
  10. 10Find the closest palindrome of a given number.MediumCoding· Uber