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

37 questions

  1. 25Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?MediumCoding· Adobe, Apple
  2. 26Build a CalculatorMediumCoding· Adobe, Apple
  3. 27Determine if an array of integers from 1 to n contains a duplicate in constant time and space.MediumCoding· Adobe, Apple
  4. 28Construct a binary tree given its preorder and inorder traversals.MediumCoding· Adobe, Amazon
  5. 29Determine if a given binary tree is a binary search tree (BST).MediumCoding· Adobe, Google
  6. 30Edit distanceHardCoding· Adobe, Amazon
  7. 31Fibonacci NumbersEasyCoding· Adobe, Google
  8. 32Given an array, find the two sum.EasyCoding· Adobe, Amazon
  9. 33Given an nxn grid of 1s and 0s, return the number of islands in the input.MediumCoding· Adobe, Amazon
  10. 34Write a function to return all prime numbers up to a given number n.MediumCoding· Adobe, Apple
  11. 35Reverse a SentenceEasyCoding· Adobe, Apple
  12. 36Reverse a linked list.EasyCoding· Adobe, Apple
  13. 37Is this a valid palindrome?EasyCoding· Adobe, Apple