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

6 questions

  1. 1Balanced TreeMediumCoding· Spotify, Uber
  2. 2Given 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
  3. 3A 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
  4. 4Find the minimum characters to insert to make a string a palindrome.MediumCoding· Uber
  5. 5Given 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
  6. 6Find the closest palindrome of a given number.MediumCoding· Uber