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
164 questions
- 145Print the top view of nodes in a binary tree.MediumCoding·
Amazon - 146Calculate the trapped rainwater between bars in a given array.HardCoding·
Adobe, Amazon - 147Find all permutations of a given string.MediumCoding·
Amazon - 148Construct a binary tree given its preorder and inorder traversals.MediumCoding·
Adobe, Amazon - 149Build an image carousel that displays a sequence of images (using React.js or vanilla JS).MediumCoding·
Amazon - 150Detect cycle in graphMediumCoding·
Amazon - 151How can you tell if a graph is not a tree?MediumCodingTechnical·
Amazon - 152Edit distanceHardCoding·
Adobe, Amazon - 153Given a factory represented as a 2D grid with some cells blocked and some containing robots, determine if the robots can collectively reach all unblocked cells.MediumCoding·
Amazon - 154Given an array of points and a point P, find the k closest points to P.MediumCoding·
Amazon, LinkedIn - 155Given a list of Nodes, each with a unique string id and a list of subnodes it depends on, find the maximum depth of the dependencies.MediumCoding·
Amazon - 156Find the palindromes.EasyCoding·
Amazon, Apple - 157Given a binary matrix with every row sorted, find the index of the row containing the most number of 1s.MediumCoding·
Amazon - 158Find the shortest path in a graph.MediumCodingTechnical·
Amazon - 159Given an array, find the two sum.EasyCoding·
Adobe, Amazon - 160Find the longest common prefix given two integer arrays.MediumCoding·
Amazon - 161Print the maximum positive sequence in a given array.MediumCoding·
Amazon - 162Implement inorder traversal for an N-ary tree.MediumCoding·
Amazon - 163Given 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 - 164Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding·
Adobe, Amazon