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

205 questions

  1. 25Given 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
  2. 26Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding· Meta, Microsoft
  3. 27Given two empty jugs with capacities a and b liters and an infinite water supply, determine a way to end up with exactly X liters of water.MediumCoding· Microsoft
  4. 28Print all combinations of numbers from 1 to n that sum to n.MediumCoding· Adobe, Apple
  5. 29Find the container with the maximum volume of water.MediumCoding· Apple, Goldman Sachs
  6. 30Given a list of conversion items between symbols, write an algorithm to return the conversion ratio for each pair of symbols.HardCodingTechnical· Snap
  7. 31Count items within compartments between specific indices of an array.MediumCoding· Amazon
  8. 32Cycle Detection in Package Manager.MediumCoding· Adobe
  9. 33Implement a hashmap without using any libraries.HardCoding· Apple, Goldman Sachs
  10. 34Explain how to design and implement a password checker based on specific requirements.MediumCodingTechnical· Peloton
  11. 35Design an indexer and a retrieverMediumCoding· Apple
  12. 36Sort a list of natural numbers and their squares in the most efficient way possible.MediumCoding· Google
  13. 37Explain the differences between stack and heap memory allocation.MediumCoding· Apple, Microsoft
  14. 38Given an array with objects colored red, white, or blue, sort them so those of the same color are adjacent. Use integers 0, 1, 2 to represent RWB respectively.MediumCoding· Apple
  15. 39Find the equilibrium index in an array where sum of elements to the left is equal to sum of elements to the right.MediumCoding· Meta
  16. 40Find the median from a data stream.MediumCoding· Bloomberg
  17. 41Find the first missing positive number in an array.HardCoding· Amazon
  18. 42Given 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
  19. 43Explain how to find a target sum in an array.MediumCoding· Adobe, Google
  20. 44Find the DuplicatesEasyCoding· Adobe, Apple
  21. 45Find a triplet in an array with a given sum.MediumCoding· Adobe, Goldman Sachs
  22. 46Generate ParenthesesMediumCoding· Adobe, Google
  23. 47Given n houses in a line with money in each, find the maximum amount a robber can steal, without stealing from two adjacent houses.MediumCoding· Adobe, Apple
  24. 48Implement a circular buffer.MediumCoding· Meta