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

1,063 questions

  1. 769Balanced TreeMediumCoding· Spotify, Uber
  2. 770Given 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
  3. 771Given a binary tree, check if each node is the average of all descendantsMediumCoding· Meta
  4. 772Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  5. 773Given the root of a binary tree of integers, return the maximum path sum.MediumCoding· Adobe, Apple
  6. 774Build a Basic Regex ParserHardCoding· Adobe, Apple
  7. 775Build 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
  8. 776Given a list with response time for each server, calculate how long time it will take to process n requests.MediumCoding· Google
  9. 777Write a function that takes an array of integers and checks for duplicate values in any contiguous window of size N.MediumCoding· Meta
  10. 778Write a function to check whether a string contains a substring.EasyCoding· Nvidia
  11. 779Given 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
  12. 780Given 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
  13. 781Given an integer n, return the number of steps to reach 1 following these rules: if n is even, divide by 2; if odd, multiply by 3 and add 1.MediumCoding· Bloomberg
  14. 782Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding· Meta, Microsoft
  15. 783Given 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
  16. 784Print all combinations of numbers from 1 to n that sum to n.MediumCoding· Adobe, Apple
  17. 785Find the container with the maximum volume of water.MediumCoding· Apple, Goldman Sachs
  18. 786Given a list of conversion items between symbols, write an algorithm to return the conversion ratio for each pair of symbols.HardCodingTechnical· Snap
  19. 787Count items within compartments between specific indices of an array.MediumCoding· Amazon
  20. 788Cycle Detection in Package Manager.MediumCoding· Adobe
  21. 789Debug a metric that was off by x percentage.MediumDataCoding· Databricks
  22. 790Delete Node in a Binary Search Tree (BST).MediumCoding· Microsoft
  23. 791Design a rewarding system.MediumCoding· Uber
  24. 792Design a banking system to facilitate account creation, deposits, transfers, and listing the most active accounts by total monetary activity, with commands entered via parsing CSV/JSON.HardCoding· Capital One