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. 241Design a queue using static memory allocation.MediumCoding· Intuit
  2. 242Design a task scheduler in Python.MediumCoding· Google, OpenAI
  3. 243Detect cycle in graphMediumCoding· Amazon
  4. 244Determine if a given binary tree is a binary search tree (BST).MediumCoding· Adobe, Google
  5. 245How can you tell if a graph is not a tree?MediumCodingTechnical· Amazon
  6. 246Given a list of integers, return 1 if the integer is a power of 2 and 0 if it is not.MediumCoding· Snap
  7. 247Determine if two sentences are similar.MediumCodingTechnical· Google
  8. 248Explain callback functions.MediumCodingTechnical· Nvidia
  9. 249Explain the filter function.MediumCoding· Apple
  10. 250Explain multithreading.MediumCoding· Microsoft, Nvidia
  11. 251Given 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
  12. 252Find the closest palindrome of a given number.MediumCoding· Uber
  13. 253Find duplicate files in a file system.MediumCodingTechnical· Anthropic, Dropbox
  14. 254Find 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
  15. 255Given an array of points and a point P, find the k closest points to P.MediumCoding· Amazon, LinkedIn
  16. 256Find Largest NumbersMediumCoding· Accenture, Goldman Sachs
  17. 257Given 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
  18. 258Find the number of rotations in a circularly sorted array.MediumCoding· AMD, Microsoft
  19. 259Given a binary matrix with every row sorted, find the index of the row containing the most number of 1s.MediumCoding· Amazon
  20. 260Find the shortest path in a graph.MediumCodingTechnical· Amazon
  21. 261Given 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
  22. 262Find the maximum subarray productMediumCoding· LinkedIn
  23. 263Given an array of integers, find a tuple of three integers that can form a triangle.MediumCoding· LinkedIn
  24. 264Implement a function to justify a list of words within a given width.MediumCoding· Google, Microsoft