Skip to content
Prepare for programming interviews with pretty practice problems.
Java Ruby JavaScript Python C Scala
Branch: master
Clone or download
Latest commit f9ab8b3 May 18, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
array_rotate Solution for array rotate problem. Mar 9, 2015
balanced_delimiter Couple of solutions Mar 3, 2015
bst_count Add bst count Mar 3, 2015
bst_height Add BST height problem Mar 3, 2015
factorial Add factorial of n problem Jan 27, 2014
fibonacci_dynamic Added Fibonacci problems. Feb 11, 2014
fibonacci_lite Added Fibonacci problems. Feb 11, 2014
find_uncoupled_int Add another Java solution Mar 3, 2015
linked_list_cycle Handle two-node no-cycle case Mar 7, 2015
linked_list_reverse Add solutions folder Mar 3, 2015
minimum_stack Add minimum stack Mar 3, 2015
queue_two_stacks add slow version Mar 3, 2015
ransom Added ransom solution May 17, 2015
target_sum Add target sum Mar 3, 2015
tree_zig_zag Added alternative zig-zag solution in Ruby. Feb 11, 2014
.gitignore Added Fibonacci problems. Feb 11, 2014 Move license to own file Jan 27, 2014 Coin change description working Jan 27, 2014

The Practice Problem Compendium

Tired of Googling around for programming interview practice problems? This is a project to build high-quality practice problems suggested for preparing for programming interviews.

Suggested Practice Questions

  1. Array Rotation: take a given array and rotate it n slots (10-20 minutes)
  2. Coin Change: how many different ways can you make change given an amount and list of coins?
  3. Tree Zig Zag: alternate between the left-most and right-most nodes in a BST.

How should you approach these problems?

  1. Code in a realistic fashion. If you're doing a whiteboard interview, practice with a whiteboard. If you don't have a whiteboard, writing your solution on paper can be a good substitute. Phone interview? Try using the online code pad they will have you use.
  2. Always compile your code after writing it. You'll often find bugs in your solution. Think—how might you catch this problem in the future?

What makes a good practice problem?

  1. Representative of many problems
  2. Has shown up (or could reasonably show up) in real interviews
  3. Takes less than an hour
  4. Not language-specific
  5. Two kinds of problems: more involved complex ones (company challenges)—good for overall practice more specific targeted problems—better for checking understanding
  6. Not breaking any confidentiality agreements

Interested in getting even more involved? Feel free to submit problems and solutions as pull requests. Email to get more involved with the group and join our planning Trello board.

You can’t perform that action at this time.