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
- 265Given a string that doesn't fit into a machine's memory, split it at each space and count the number of spaces.MediumCoding·
Apple - 266Given 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 - 267Implement a doubly linked list.MediumCoding·
Anduril, Apple - 268Given 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 - 269Find the longest common prefix given two integer arrays.MediumCoding·
Amazon - 270Given 2 strings, return the longest common substring.MediumCoding·
Salesforce - 271Given 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 - 272Print the maximum positive sequence in a given array.MediumCoding·
Amazon - 273What percentage of users who were active on Messenger yesterday made a video call yesterday?MediumCodingData·
Meta - 274Given 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 - 275Given 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 - 276Implement inorder traversal for an N-ary tree.MediumCoding·
Amazon - 277Given 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 - 278Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding·
Adobe, Amazon - 279Determine if a number is a power of two.MediumCoding·
Salesforce - 280Write a function to return all prime numbers up to a given number n.MediumCoding·
Adobe, Apple - 281Solve an interval scheduling problem by finding “free time” intervals to accept queries.MediumCoding·
Scale AI - 282Implement a queue using stacks.MediumCoding·
Goldman Sachs - 283Review the given code for a React.js based Tic-tac-toe game written in Typescript and suggest improvements.MediumCoding·
MongoDB - 284Remove Duplicate EmailsMediumCodingData·
IBM - 285Given a head node of a linked list, delete k-th node from the end of the list.MediumCoding·
Meta - 286Given the row and column, return the value at that position in Pascal's triangle.MediumCoding·
Goldman Sachs - 287Set Matrix ZeroesMediumCoding·
Apple - 288Infection spread simulation.MediumCoding·
OpenAI