Practice Questions and Resources
Coding Every Day
Coding for Interviews (free!)
Okay, I'm biased, because I run this group. But I honestly think it's the best long-term way of becoming and staying prepared for programming interviews. Each week, the 18,000 Coding for Interviews subscribers receive two things:
- A programming interview question
- A distilled computer science topic review
You send in your answer and the next week we review solutions.
We practice a little bit each week. The idea is, the next time our group members are looking for jobs, we will be prepared.
New group members are always welcome!
One email each week. No spam. Easy unsubscribe.
- Write your solution on a whiteboard or on a piece of paper first. This will be much more like the real thing, and you can type up and test your code afterwards.
- Do any memorization or topic reading as the last thing before bed. A study found studying before bed leads to significantly better retention (2011)
- The best preparation is to do real in-person interviews. Interview at a few companies before your target company.
Books (full list)
See the full reading list for books with practice problems. Look for:
- Cracking the Coding Interview (start with this)
- Be sure to get the fifth edition, not the fourth. It's worth the money. There are way more practice problems and new sections you don't want to miss out on.
- Elements of Programming Interviews—tons of problems, start with the recommended problem list
- Programming Interviews Exposed
- Algorithm Design Manual
And my librarian mother would be upset if I didn't remind you—you can always check your local library for these books. Try before you buy, and force yourself to prepare before the due date!
Especially for phone screens, it's important to exhibit a comfort with coding. I.e., once you come up with the algorithm, showing that you can code it out. CodeWars is a great practice problem website with a ton of excellent "kata", small code challenges and finger exercises. Integrating 10-20 minutes of this in your morning routine will pay dividends in your code fluency in the long term.
Interactive practice problems
Interview Cake is a novel step-by-step interview problem walkthrough tool that simulates a realistic coding interview, giving you hints and challenging your answers along the way. But I'm biased—I guest-wrote one of the problems!
Formerly part of Interview Street's code sprints, Hacker Rank has a nice selection of practice problems. They support over 20 programming languages and have a nice selection of questions for bit manipulation, sorting, string processing, dynamic programming and a handful of math-heavy problems.
CodeEval supports 13 languages and has a selection of programming problems sponsored by individual employers—the sponsors are actually sent a copy of your solution and offered the chance to contact you.
CodeEval has roughly 100 problems of different difficulties, including a solid selection of classic programming interview questions. If you want a set of problems to go through in order, these are well written and very accessible.
TopCoder is an online programming competition which has been around for a long time. For most of TopCoder's problems, you can only use Java, C++ and C#. Some challenges let you use Python.
The TopCoder problem database is practically endless. Start with a TopCoder HS Single Round Match (SRM) or two and then move on to a standard TopCoder SRM. The SRMs can take anywhere between 30 minutes and a couple of hours.
Read the solutions, but be wary of the code style used in these competitions. The hardcore competitors eschew sensical variable naming and instead compress their logic in a way that would make the author of Clean Code shed a tear.
CodingBat (Java / Python only)
CodingBat is a great site for more novice developers to become more comfortable with iteration patterns, string manipulation and more.
The help and videos section has some excellent accessible explanations of some solutions and basic programming techniques.
Practice problem repositories
- Glassdoor—lots of questions asked in real coding interviews
- LeetCode—sure, it has a silly name, but the problems and explanations are very high quality. Also check out their online judge which supports C++, Java and Python
- Geeks for Geeks
- Career Cup—from the author of Cracking the Coding Interview
- Programming Praxis—solutions in the comments tend to be pretty good