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. 145Write a function that takes an array of integers and checks for duplicate values in any contiguous window of size N.MediumCoding· Meta
  2. 146Given a castle with rooms named after flowers where each room has an instruction to the next room, write an algorithm to find the rooms containing treasure.MediumCoding· PayPal
  3. 147Given 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
  4. 148Given an integer n, return the number of steps to reach 1 following these rules: if n is even, divide by 2; if odd, multiply by 3 and add 1.MediumCoding· Bloomberg
  5. 149Given an array of integers and an integer k, find the kth largest element in the array.MediumCoding· Meta, Microsoft
  6. 150Given 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
  7. 151Print all combinations of numbers from 1 to n that sum to n.MediumCoding· Adobe, Apple
  8. 152Find the container with the maximum volume of water.MediumCoding· Apple, Goldman Sachs
  9. 153Count items within compartments between specific indices of an array.MediumCoding· Amazon
  10. 154Cycle Detection in Package Manager.MediumCoding· Adobe
  11. 155Debug a metric that was off by x percentage.MediumDataCoding· Databricks
  12. 156Delete Node in a Binary Search Tree (BST).MediumCoding· Microsoft
  13. 157Design a rewarding system.MediumCoding· Uber
  14. 158Design a file upload feature for an AI chat application.MediumCodingSystem design· xAI
  15. 159Explain how to design and implement a password checker based on specific requirements.MediumCodingTechnical· Peloton
  16. 160Design an indexer and a retrieverMediumCoding· Apple
  17. 161Explain the differences between an interface and an abstract class.MediumCodingTechnical· Goldman Sachs, Microsoft
  18. 162Sort a list of natural numbers and their squares in the most efficient way possible.MediumCoding· Google
  19. 163Explain malloc, calloc, and reelloc.MediumCodingTechnical· Google
  20. 164Explain the differences between stack and heap memory allocation.MediumCoding· Apple, Microsoft
  21. 165Find a local minima in an array Last UpdatedMediumCoding· Meta
  22. 166Given 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
  23. 167Find the equilibrium index in an array where sum of elements to the left is equal to sum of elements to the right.MediumCoding· Meta
  24. 168Find the median from a data stream.MediumCoding· Bloomberg