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
343 questions
- 193A 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 - 194Maximum Number of Visible PointsMediumCoding·
Apple - 195Find the maximum product of any two integers in an array.MediumCoding·
Amazon - 196Find the maximum possible stability of any subset of servers. Return the result modulo 10^9+7. E.g. Consider set of servers where reliability = [1, 2, 2], availability = [1, 1, 3].MediumCoding·
Amazon - 197Find the maximum subarray sum.MediumCoding·
Adobe, Apple - 198Find the minimum characters to insert to make a string a palindrome.MediumCoding·
Uber - 199Given a large n-ary tree where the root node can pass information to one child per iteration, and in subsequent iterations, nodes can pass information to one child while the root continues with others, find the minimum number of iterations to reach all nodes.MediumCoding·
Google - 200Find the minimum window substring.MediumCoding·
Airbnb, Dropbox - 201Partition an array into two sub-arrays with equal sum.MediumCoding·
Apple, LinkedIn - 202Print all words from a dictionary that can be found on a given Boggle board.MediumCoding·
Microsoft - 203Write functions to serialize and deserialize a list of strings.MediumCoding·
Google, Nvidia - 204Sort an array containing only 0s, 1s, and 2s.MediumCodingTechnical·
LinkedIn - 205How do you split a machine learning dataset for training, evaluation, and testing?MediumCoding·
Amazon - 206Write a query to find the top 3 unique salaries in each department and list all employees who have those salaries.MediumCodingData·
Amazon - 207Squares of sorted arrayMediumCoding·
Meta, PayPal - 208Given 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 - 209How would you store a list of numbers as a single number?MediumCodingTechnical·
Atlassian, Microsoft - 210Get the top API users based on transaction logs.MediumCoding·
Amazon - 211Given a list of sentences, find the top n most frequent words.MediumCoding·
Microsoft - 212Print the top view of nodes in a binary tree.MediumCoding·
Amazon - 213Transform a flat array of objects into a nested list.MediumCoding·
New York Times - 214Given a string s, return true if the s can be a palindrome after deleting at most one character from it.MediumCoding·
Meta - 215If given two strings, each containing a number larger than 32-bit, how do you add them and return the result as a string?MediumCodingTechnical·
Waymo - 216Find all permutations of a given string.MediumCoding·
Amazon