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

36 questions

  1. 1Merge IntervalsMediumCoding· Blinkit, Docquity Holdings(PBS)
  2. 2Top k frequent elementsMediumCoding· Amazon, Apple
  3. 3Product of Array Except SelfMediumCoding· PayPal, Target
  4. 4Sort a K-Messed ArrayMediumCoding· Meta
  5. 5Write a function to balance parentheses in a given string by removing the fewest characters possible. Ensure that each opening parenthesis has a corresponding closing parenthesis and each pair is properly nested.MediumCoding· Meta
  6. 6Given a string with parentheses, write a function that removes the minimum number of characters to balance the parentheses.MediumCoding· Meta
  7. 7Given a binary tree, check if each node is the average of all descendantsMediumCoding· Meta
  8. 8Given the root of a binary tree, return the length of the diameter of the tree.MediumCoding· Amazon, Google
  9. 9Given a collection of rooms where Alibada is in one and moves one room a day to an adjacent room, write a program to determine if you can find Alibada with the given list of rooms.MediumCoding· Meta
  10. 10Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding· Meta, Microsoft
  11. 11Find the equilibrium index in an array where sum of elements to the left is equal to sum of elements to the right.MediumCoding· Meta
  12. 12Given a list of strings, find all strings that encode to the same value using a Caesar Cipher. (A Caesar Cipher rotates characters, e.g. in CC3: a->d, b->e, ..., z->c)MediumCoding· Meta, Pinterest
  13. 13Explain how to find a target sum in an array.MediumCoding· Adobe, Google
  14. 14Generate ParenthesesMediumCoding· Adobe, Google
  15. 15Implement a circular buffer.MediumCoding· Meta
  16. 16Implement the memcpy() function in C.MediumCoding· Meta
  17. 17Implement TrieMediumCoding· Apple, Goldman Sachs
  18. 18Find the largest perimeter of an island given a two-dimensional array of 1's and 0's representing land and water.MediumCoding· Bloomberg, Meta
  19. 19Find the lowest common ancestor (LCA) of two nodes in a binary tree.MediumCoding· Apple, LinkedIn
  20. 20Partition an array into two sub-arrays with equal sum.MediumCoding· Apple, LinkedIn
  21. 21Squares of sorted arrayMediumCoding· Meta, PayPal
  22. 22Given a string s, return true if the s can be a palindrome after deleting at most one character from it.MediumCoding· Meta
  23. 23Vertical Traversal of a Binary TreeMediumCoding· Meta, Oracle
  24. 24Find the first common ancestor of two nodes in a binary tree.MediumCoding· Meta