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. 97Determine if a given binary tree is a binary search tree (BST).MediumCoding· Adobe, Google
  2. 98How can you tell if a graph is not a tree?MediumCodingTechnical· Amazon
  3. 99Given a list of integers, return 1 if the integer is a power of 2 and 0 if it is not.MediumCoding· Snap
  4. 100Determine if two sentences are similar.MediumCodingTechnical· Google
  5. 101What is encapsulation?MediumCodingTechnical· Accenture
  6. 102Explain the filter function.MediumCoding· Apple
  7. 103Explain multithreading.MediumCoding· Microsoft, Nvidia
  8. 104Given a factory represented as a 2D grid with some cells blocked and some containing robots, determine if the robots can collectively reach all unblocked cells.MediumCoding· Amazon
  9. 105Find the closest palindrome of a given number.MediumCoding· Uber
  10. 106Find duplicate files in a file system.MediumCodingTechnical· Anthropic, Dropbox
  11. 107Find the element at a given position in a sorted version of an unsorted array. Example: Input: {5,1,7,19,0,16}, k=3 Output: 5 (Explanation: Sorted array is {0,1,5,7,16,19}, and the 3rd positioned element is 5.)MediumCodingTechnical· Philips
  12. 108Given an array of points and a point P, find the k closest points to P.MediumCoding· Amazon, LinkedIn
  13. 109Find Largest NumbersMediumCoding· Accenture, Goldman Sachs
  14. 110Given a list of Nodes, each with a unique string id and a list of subnodes it depends on, find the maximum depth of the dependencies.MediumCoding· Amazon
  15. 111Find the number of rotations in a circularly sorted array.MediumCoding· AMD, Microsoft
  16. 112Given a binary matrix with every row sorted, find the index of the row containing the most number of 1s.MediumCoding· Amazon
  17. 113Find the shortest path in a graph.MediumCodingTechnical· Amazon
  18. 114Given an array of task durations (in minutes), return the pairs of tasks that can be completed within 60 minutes. For example, for [1, 43, 20, 59, 30, 30], return [[0, 3], [4, 5]].MediumCoding· DoorDash
  19. 115Given an array of integers, find a tuple of three integers that can form a triangle.MediumCoding· LinkedIn
  20. 116Implement a function to justify a list of words within a given width.MediumCoding· Google, Microsoft
  21. 117Given a string that doesn't fit into a machine's memory, split it at each space and count the number of spaces.MediumCoding· Apple
  22. 118Given 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
  23. 119Implement a doubly linked list.MediumCoding· Anduril, Apple
  24. 120Given 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