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. 73Transform a flat array of objects into a nested list.MediumCoding· New York Times
  2. 74Given a string s, return true if the s can be a palindrome after deleting at most one character from it.MediumCoding· Meta
  3. 75Vertical Traversal of a Binary TreeMediumCoding· Meta, Oracle
  4. 76If 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
  5. 77Find all permutations of a given string.MediumCoding· Amazon
  6. 78Calculate the average distance between cities.MediumCodingProduct· Waymo
  7. 79Find the first common ancestor of two nodes in a binary tree.MediumCoding· Meta
  8. 80How would you sort a bitonic array efficiently?MediumCoding· Oracle
  9. 81Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding· Adobe, Apple
  10. 82Build a CalculatorMediumCoding· Adobe, Apple
  11. 83Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding· Adobe, Apple
  12. 84How would you implement a child-parent relation for finding the Least Common Ancestor (LCA) without using pointers?MediumCoding· Samsung
  13. 85Find the closest number in a sorted array.MediumCoding· DoorDash
  14. 86Given an array of integers, return the pairs with the minimum absolute difference between them.MediumCoding· Microsoft
  15. 87Given an integer, reverse it. Integers are within range [-2^15, 2^15 - 1].MediumCoding· Microsoft
  16. 88Construct a binary tree from an ancestor matrix.MediumCodingTechnical· LinkedIn
  17. 89Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon
  18. 90Given a string, return the number of vowel substrings ('a', 'e', 'i', 'o', 'u') that include all five vowels.MediumCoding· Oracle
  19. 91Design a data structure that supports insert, delete, search, and retrieve in constant time.MediumCoding· Meta
  20. 92If you have a vector with many values, mostly zeroes, how would you design a data structure to represent it?MediumCodingTechnical· WWhatsApp
  21. 93Design LFU cache.MediumCodingSystem design· Microsoft
  22. 94Design a queue using static memory allocation.MediumCoding· Intuit
  23. 95Design a task scheduler in Python.MediumCoding· Google, OpenAI
  24. 96Detect cycle in graphMediumCoding· Amazon