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
- 49Find the largest perimeter of an island given a two-dimensional array of 1's and 0's representing land and water.MediumCoding·
Bloomberg, Meta - 50PermutationsMediumCoding·
Adobe, Apple - 51Lexicographic Grid Travel.MediumCoding·
Databricks - 52Given 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 - 53Find the longest palindromic subsequence using dynamic programming.MediumCoding·
Adobe, Apple - 54Find the longest substring without repeating characters.MediumCoding·
Apple, Intuit - 55Find the lowest common ancestor (LCA) of two nodes in a binary tree.MediumCoding·
Apple, LinkedIn - 56A 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 - 57Maximum Number of Visible PointsMediumCoding·
Apple - 58Find the maximum product of any two integers in an array.MediumCoding·
Amazon - 59Find the maximum subarray sum.MediumCoding·
Adobe, Apple - 60Find the minimum characters to insert to make a string a palindrome.MediumCoding·
Uber - 61Given 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 - 62Find the minimum window substring.MediumCoding·
Airbnb, Dropbox - 63Partition an array into two sub-arrays with equal sum.MediumCoding·
Apple, LinkedIn - 64Print all words from a dictionary that can be found on a given Boggle board.MediumCoding·
Microsoft - 65Write functions to serialize and deserialize a list of strings.MediumCoding·
Google, Nvidia - 66Sort an array containing only 0s, 1s, and 2s.MediumCodingTechnical·
LinkedIn - 67How do you split a machine learning dataset for training, evaluation, and testing?MediumCoding·
Amazon - 68Squares of sorted arrayMediumCoding·
Meta, PayPal - 69Given 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 - 70How would you store a list of numbers as a single number?MediumCodingTechnical·
Atlassian, Microsoft - 71Get the top API users based on transaction logs.MediumCoding·
Amazon - 72Print the top view of nodes in a binary tree.MediumCoding·
Amazon