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

32 questions

  1. 1Climbing StairsEasyCoding· Media.net
  2. 2Merge IntervalsMediumCoding· Blinkit, Docquity Holdings(PBS)
  3. 3Given a list of car rental requests with start and end times, assign cars to rentals such that the total number of cars used is minimized.MediumCoding· Google
  4. 4Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  5. 5Sort a list of natural numbers and their squares in the most efficient way possible.MediumCoding· Google
  6. 6Explain how to find a target sum in an array.MediumCoding· Adobe, Google
  7. 7Generate ParenthesesMediumCoding· Adobe, Google
  8. 8Sort a nearly sorted (or K sorted) array.MediumCoding· Google
  9. 9PermutationsMediumCoding· Adobe, Apple
  10. 10Find the longest palindromic subsequence using dynamic programming.MediumCoding· Adobe, Apple
  11. 11Maximum ProfitEasyCoding· Google
  12. 12Find the maximum subarray sum.MediumCoding· Adobe, Apple
  13. 13Merge k sorted linked lists.HardCoding· Adobe, Apple
  14. 14Given a large n-ary tree where the root node can pass information to one child per iteration, and in subsequent iterations, nodes can pass information to one child while the root continues with others, find the minimum number of iterations to reach all nodes.MediumCoding· Google
  15. 15Given a matrix with a rat, bread, cat, and obstacles, find a path from the rat to the bread that maximizes the minimum distance from cat.HardCoding· Google
  16. 16Write functions to serialize and deserialize a list of strings.MediumCoding· Google, Nvidia
  17. 17Sort a binary array in linear time.EasyCoding· Accenture, Apple
  18. 18Given an integer array nums and an integer k, return true if nums has a subarray of at least two elements whose sum is a multiple of k.HardCoding· Adobe, Apple
  19. 19Calculate the height of a binary tree.EasyCoding· Apple, Google
  20. 20Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon
  21. 21Count the number of ways to split a string.EasyCoding· Google
  22. 22Degrees of FriendshipEasyCoding· Google
  23. 23Design a task scheduler in Python.MediumCoding· Google, OpenAI
  24. 24Determine if a given binary tree is a binary search tree (BST).MediumCoding· Adobe, Google