Home - Elements of Programming Interviews

Elements of Programming Interviews

Many of the best ideas in the book (e.g., the study guide, ninja notation, the C++11 and Java review) came from reader feedback. Please contact us, or post on the Discourse forum, with suggestions for improvement.

Latest Post

04 December 2015

Online Judge

Jan 14, 2016

We've put together a prototype online judge service that you can use to practice for interviews.

Take a look at the screenshot at the end to see the UI, or just click on the link. No login is needed, just read the problem description and start hacking!

The judge problems correspond to the problems in the PDF sample. These problems are an ideal starting point for anyone who wants to get up to speed with interviewing. (Right now, all programs are in Java.)


We use directed tests for the judge problems, and try to give meaningful feedback. For example, if your program for testing if a binary tree is balanced fails, you will see a report like the following.

Incorrect result on balanced tree {0,1,2,3,#,4,5}

If your program fails to compile, we return the compiler error, and the line numbers will correspond to the lines in your program.

Line 7: error: incompatible types
    int y  = "asd";
  required: int
  found:    String
1 error

If your program throws an exception, we return the stacktrace - the line numbers will not correspond to the lines in your program.

Exception in thread "main" java.lang.RuntimeException
    at BalancedBinaryTree.isBalanced(file.java:49)
    at BalancedBinaryTree.main(file.java:86)

Your program runs in Docker container, so don't worry about crashing or damaging our server. We run the program with a timeout of 20 seconds, so if your program has an infinite loop, or is very slow, you'll get a timeout response. If the server is under load, it may block requests that are too frequent.

A few programs require you to have an efficient solution to pass, e.g., if you brute-force compute the parity, you will see the judge informs you that your solution is too slow:

Execution Timed Out


We're very excited about offering this service, and look forward to developing it - adding more problems, adding a login and persisting your code, classification of problens, drag-and-drop into the editor, executing from Github, etc.

Reader Input

As always, we treasure user input. Please share your thoughts with us about the judge. Some things we're especially keen on learning about are:

  1. Bugs, e.g., program never returns, hint button doesn't work, etc.
  2. Source of confusion, e.g., misleading stack traces, wording of error
  3. General UI issues: is editor font ok? do you prefer a light background?
  4. How important are features like login, timing, etc.?

As huge fans of Stack Overflow and Discourse, we have to share this quote about EPI by Jeff Atwood, who co-founded both: A practical, fun approach to computer science fundamentals, as seen through the lens of common programming interview questions.