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
155 questions
- 1Koko eating bananas.MediumCoding·
Flipkart, Amazon - 2Merge IntervalsMediumCoding·
Blinkit, Docquity Holdings(PBS) - 3Top k frequent elementsMediumCoding·
Amazon, Apple - 4Group anagramsMediumCoding·
Blinkit, MakeMyTrip - 5Product of Array Except SelfMediumCoding·
PayPal, Target - 6Sort a K-Messed ArrayMediumCoding·
Meta - 7Course ScheduleMediumCoding·
Zoho - 8Validate IP AddressMediumCoding·
Salesforce - 901 Matrix: find the nearest zero for every cellMediumCoding·
Adobe, Oracle - 10Given 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 - 11Write 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 - 12Given a string with parentheses, write a function that removes the minimum number of characters to balance the parentheses.MediumCoding·
Meta - 13Balanced TreeMediumCoding·
Spotify, Uber - 14Given 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 - 15Given a binary tree, check if each node is the average of all descendantsMediumCoding·
Meta - 16Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding·
Amazon, Google - 17Given the root of a binary tree of integers, return the maximum path sum.MediumCoding·
Adobe, Apple - 18Given 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 - 19Given 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 - 20Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding·
Meta, Microsoft - 21Given 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 - 22Print all combinations of numbers from 1 to n that sum to n.MediumCoding·
Adobe, Apple - 23Find the container with the maximum volume of water.MediumCoding·
Apple, Goldman Sachs - 24Count items within compartments between specific indices of an array.MediumCoding·
Amazon