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
- 121Determine the latency for a hashmap with given data.MediumCoding·
Apple - 122Find the longest common prefix given two integer arrays.MediumCoding·
Amazon - 123Given 2 strings, return the longest common substring.MediumCoding·
Salesforce - 124Given 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 - 125Print the maximum positive sequence in a given array.MediumCoding·
Amazon - 126Given 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 - 127Given 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 - 128Implement inorder traversal for an N-ary tree.MediumCoding·
Amazon - 129Given 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 - 130Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding·
Adobe, Amazon - 131Determine if a number is a power of two.MediumCoding·
Salesforce - 132Write a function to return all prime numbers up to a given number n.MediumCoding·
Adobe, Apple - 133Implement a queue using stacks.MediumCoding·
Goldman Sachs - 134Given a head node of a linked list, delete k-th node from the end of the list.MediumCoding·
Meta - 135Given the row and column, return the value at that position in Pascal's triangle.MediumCoding·
Goldman Sachs - 136Set Matrix ZeroesMediumCoding·
Apple - 137Infection spread simulation.MediumCoding·
OpenAI - 138Sort a doubly linked list using merge sort.MediumCodingTechnical·
Meta - 139Given an array of integers, print all subarrays that sum to zero.MediumCodingData·
Meta - 140Find the sum of all elements in a binary tree that fall within the range [low, high], where 'low' and 'high' are integers.MediumCoding·
Meta - 141Given a list of trades, iterate to return buy/sell pairs and overall profit.MediumCodingTechnical·
Robinhood - 142Which sorting algorithms use divide and conquer?MediumCodingTechnical·
Meta - 143Given two strings, return true if you could change 2 letters in the s string and return the goal string. If this isn't possible, return false.MediumCoding
- 144Copy a Spiral MatrixMediumCoding