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
205 questions
- 145Find peak element in an arrayEasyCoding·
Apple - 146Given a binary matrix with every row sorted, find the index of the row containing the most number of 1s.MediumCoding·
Amazon - 147Find the shortest path in a graph.MediumCodingTechnical·
Amazon - 148Given an array of task durations (in minutes), return the pairs of tasks that can be completed within 60 minutes. For example, for [1, 43, 20, 59, 30, 30], return [[0, 3], [4, 5]].MediumCoding·
DoorDash - 149Given an array of integers, find a tuple of three integers that can form a triangle.MediumCoding·
LinkedIn - 150Given an array, find the two sum.EasyCoding·
Adobe, Amazon - 151Given two strings of equal length, determine if it's possible to form a palindrome by cutting them in half.EasyCoding·
Google - 152Implement a function to justify a list of words within a given width.MediumCoding·
Google, Microsoft - 153Given a string that doesn't fit into a machine's memory, split it at each space and count the number of spaces.MediumCoding·
Apple - 154Given an array representing the height of buildings from a sea beach, return an array of heights of the buildings that have a sea view.MediumCoding·
Meta - 155Implement a doubly linked list.MediumCoding·
Anduril, Apple - 156Implement a red-black tree.HardCoding·
Apple - 157Given a list of jobs and a list of dependencies where each job depends on another job being completed first, determine if it is possible to complete all jobs.MediumCoding·
Oracle - 158Determine the latency for a hashmap with given data.MediumCoding·
Apple - 159Find the longest common prefix given two integer arrays.MediumCoding·
Amazon - 160Given 2 strings, return the longest common substring.MediumCoding·
Salesforce - 161Given an array of n integers and a number k, find the maximum number of elements whose sum is less than k, and return their sum.MediumCoding·
Goldman Sachs - 162Print the maximum positive sequence in a given array.MediumCoding·
Amazon - 163Given a binary array where an operation cycles a row's elements to the left or right, return the minimum number of operations needed to create a column of 1s. If not possible, return 0.MediumCoding·
Palantir - 164Given positions of N kids and M ice cream sellers on a 1D line, find the smallest distance E such that every kid lies within the range [P - E, P + E] of at least one seller.MediumCoding·
Google - 165Implement inorder traversal for an N-ary tree.MediumCoding·
Amazon - 166Given an array, print the Next Greater Element (NGE) for each element. The NGE for an element x is the first greater element on the right side of x in the array, or -1 if none exists.MediumCoding·
Amazon - 167Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding·
Adobe, Amazon - 168Determine if a number is a power of two.MediumCoding·
Salesforce