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

  1. 121Determine the latency for a hashmap with given data.MediumCoding· Apple
  2. 122Find the longest common prefix given two integer arrays.MediumCoding· Amazon
  3. 123Given 2 strings, return the longest common substring.MediumCoding· Salesforce
  4. 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
  5. 125Print the maximum positive sequence in a given array.MediumCoding· Amazon
  6. 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
  7. 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
  8. 128Implement inorder traversal for an N-ary tree.MediumCoding· Amazon
  9. 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
  10. 130Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding· Adobe, Amazon
  11. 131Determine if a number is a power of two.MediumCoding· Salesforce
  12. 132Write a function to return all prime numbers up to a given number n.MediumCoding· Adobe, Apple
  13. 133Implement a queue using stacks.MediumCoding· Goldman Sachs
  14. 134Given a head node of a linked list, delete k-th node from the end of the list.MediumCoding· Meta
  15. 135Given the row and column, return the value at that position in Pascal's triangle.MediumCoding· Goldman Sachs
  16. 136Set Matrix ZeroesMediumCoding· Apple
  17. 137Infection spread simulation.MediumCoding· OpenAI
  18. 138Sort a doubly linked list using merge sort.MediumCodingTechnical· Meta
  19. 139Given an array of integers, print all subarrays that sum to zero.MediumCodingData· Meta
  20. 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
  21. 141Given a list of trades, iterate to return buy/sell pairs and overall profit.MediumCodingTechnical· Robinhood
  22. 142Which sorting algorithms use divide and conquer?MediumCodingTechnical· Meta
  23. 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
  24. 144Copy a Spiral MatrixMediumCoding