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

46 questions

  1. 25Squares of sorted arrayMediumCoding· Meta, PayPal
  2. 26Calculate the trapped rainwater between bars in a given array.HardCoding· Adobe, Amazon
  3. 27Given a string s, return true if the s can be a palindrome after deleting at most one character from it.MediumCoding· Meta
  4. 28Vertical Traversal of a Binary TreeMediumCoding· Meta, Oracle
  5. 29Find the first common ancestor of two nodes in a binary tree.MediumCoding· Meta
  6. 30Build a CalculatorMediumCoding· Adobe, Apple
  7. 31Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon
  8. 32Design a data structure that supports insert, delete, search, and retrieve in constant time.MediumCoding· Meta
  9. 33Determine if a given binary tree is a binary search tree (BST).MediumCoding· Adobe, Google
  10. 34Given an array of points and a point P, find the k closest points to P.MediumCoding· Amazon, LinkedIn
  11. 35Given an array, find the two sum.EasyCoding· Adobe, Amazon
  12. 36Given 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
  13. 37Implement a doubly linked list.MediumCoding· Anduril, Apple
  14. 38Given a head node of a linked list, delete k-th node from the end of the list.MediumCoding· Meta
  15. 39Reverse a linked list.EasyCoding· Adobe, Apple
  16. 40Find the smallest missing element from a sorted array.EasyCodingTechnical· Meta
  17. 41Sort a doubly linked list using merge sort.MediumCodingTechnical· Meta
  18. 42Given an array of integers, print all subarrays that sum to zero.MediumCodingData· Meta
  19. 43Find the sum of all elements in a binary tree that fall within the range [low, high], where 'low' and 'high' are integers.MediumCoding· Meta
  20. 44Valid ParenthesesEasyCoding· Apple, Booking.com
  21. 45Is this a valid palindrome?EasyCoding· Adobe, Apple
  22. 46Which sorting algorithms use divide and conquer?MediumCodingTechnical· Meta