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

1,063 questions

  1. 865Given a list of sentences, find the top n most frequent words.MediumCoding· Microsoft
  2. 866Print the top view of nodes in a binary tree.MediumCoding· Amazon
  3. 867Transform a flat array of objects into a nested list.MediumCoding· New York Times
  4. 868Calculate the trapped rainwater between bars in a given array.HardCoding· Adobe, Amazon
  5. 869Given a string s, return true if the s can be a palindrome after deleting at most one character from it.MediumCoding· Meta
  6. 870If given two strings, each containing a number larger than 32-bit, how do you add them and return the result as a string?MediumCodingTechnical· Waymo
  7. 871Find all permutations of a given string.MediumCoding· Amazon
  8. 872Calculate the average distance between cities.MediumCodingProduct· Waymo
  9. 873Find the first common ancestor of two nodes in a binary tree.MediumCoding· Meta
  10. 874How would you sort a bitonic array efficiently?MediumCoding· Oracle
  11. 875Given a bookstore database schema, write SQL queries using joins and aggregations to answer questions about sales, inventory, and customer data.MediumCodingData· Meta
  12. 876Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding· Adobe, Apple
  13. 877Calculate the height of a binary tree.EasyCoding· Apple, Google
  14. 878Calculate the number of times a pattern appears in a string.HardCoding· LinkedIn
  15. 879Calculate Test ScoresMediumCodingData· Google
  16. 880Build a CalculatorMediumCoding· Adobe, Apple
  17. 881Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding· Adobe, Apple
  18. 882Find the closest number in a sorted array.MediumCoding· DoorDash
  19. 883Given an array of points on a plane (x,y), write a function to return the distance between the closest pair of points.HardCoding· Visa
  20. 884Given an array of integers, return the pairs with the minimum absolute difference between them.MediumCoding· Microsoft
  21. 885Given an integer, reverse it. Integers are within range [-2^15, 2^15 - 1].MediumCoding· Microsoft
  22. 886Coin ChangeMediumCodingTechnical· Apple, Citi
  23. 887Construct a binary tree from an ancestor matrix.MediumCodingTechnical· LinkedIn
  24. 888Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon