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
- 769Balanced TreeMediumCoding·
Spotify, Uber - 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 - 771Given a binary tree, check if each node is the average of all descendantsMediumCoding·
Meta - 772Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding·
Amazon, Google - 773Given the root of a binary tree of integers, return the maximum path sum.MediumCoding·
Adobe, Apple - 774Build a Basic Regex ParserHardCoding·
Adobe, Apple - 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 - 776Given a list with response time for each server, calculate how long time it will take to process n requests.MediumCoding·
Google - 777Write a function that takes an array of integers and checks for duplicate values in any contiguous window of size N.MediumCoding·
Meta - 778Write a function to check whether a string contains a substring.EasyCoding·
Nvidia - 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 - 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 - 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 - 782Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding·
Meta, Microsoft - 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 - 784Print all combinations of numbers from 1 to n that sum to n.MediumCoding·
Adobe, Apple - 785Find the container with the maximum volume of water.MediumCoding·
Apple, Goldman Sachs - 786Given a list of conversion items between symbols, write an algorithm to return the conversion ratio for each pair of symbols.HardCodingTechnical·
Snap - 787Count items within compartments between specific indices of an array.MediumCoding·
Amazon - 788Cycle Detection in Package Manager.MediumCoding·
Adobe - 789Debug a metric that was off by x percentage.MediumDataCoding·
Databricks - 790Delete Node in a Binary Search Tree (BST).MediumCoding·
Microsoft - 791Design a rewarding system.MediumCoding·
Uber - 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