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. 169Given 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
  2. 170Explain how to find a target sum in an array.MediumCoding· Adobe, Google
  3. 171Find a triplet in an array with a given sum.MediumCoding· Adobe, Goldman Sachs
  4. 172Given an array of numbers where every number occurs twice except one, how would you find the unique number in O(log n) time?MediumCoding· Meta
  5. 173Generate ParenthesesMediumCoding· Adobe, Google
  6. 174Given 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
  7. 175Implement a circular buffer.MediumCoding· Meta
  8. 176Implement file searchMediumCoding· Amazon
  9. 177Implement the memcpy() function in C.MediumCoding· Meta
  10. 178Implement merge-sortMediumCoding· Walmart Labs
  11. 179Implement a phrase search in a list of documents.MediumCoding· Amazon, Confluent
  12. 180Implement a string sorting algorithm, treating digits as numbers.MediumCoding· Bolt
  13. 181Implement TrieMediumCoding· Apple, Goldman Sachs
  14. 182Implement wildcard pattern matching for a string (s) and a pattern (p) with '?' and '*' in a way that covers the entire input string.MediumCoding· Service Now
  15. 183You're given a time-based key-value store that keeps having new key-value pairs added. Implement a windowed average.MediumCoding· Confluent
  16. 184Sort a nearly sorted (or K sorted) array.MediumCoding· Google
  17. 185Find the k-th smallest and k-th largest element in a binary search tree (BST).MediumCodingTechnical· LinkedIn
  18. 186Find 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. 187PermutationsMediumCoding· Adobe, Apple
  20. 188Lexicographic Grid Travel.MediumCoding· Databricks
  21. 189Given an array of integers and a number N, find the length of the longest contiguous subarray such that the difference between any two elements in the subarray is less than N.MediumCoding· Uber
  22. 190Find the longest palindromic subsequence using dynamic programming.MediumCoding· Adobe, Apple
  23. 191Find the longest substring without repeating characters.MediumCoding· Apple, Intuit
  24. 192Find the lowest common ancestor (LCA) of two nodes in a binary tree.MediumCoding· Apple, LinkedIn