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

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