"Programming Interviews Exposed: Secrets to Landing Your Next Job"
(2nd edn), John Mongan, Noah Suojanen and Eric Giguère (2nd edn, 2007)
is a good book, but so is the very similar "Cracking the coding
interview" (4th ed, 2008) by Gayle Laakman. Which should you choose?
Here are the main differences:
- "Exposed" is much more readable: it explains the solutions in
English before giving code, whereas "Cracking" often just presents
code with minimal explanation. Another nice thing is that "Exposed"
presents the solution in stages, so you can read the first part of the
solution to get a hint, and then try again. By contrast, "Cracking"
just gives the key idea right away, so even a "peek" at the solutions
means it's game over (modulo coding issues, which are usually easy).
- "Cracking" has more questions, and they generally seem to be a bit
harder. They are sorted in order of increasing difficulty, which is
helpful.
- "Cracking" gives solutions in Java, although the code seems to have
some errors (see other reviews on amazon). "Exposed" gives solutions
in a mix of languages (C++, Java, C#), although they only use one
language per question.
- "Cracking" contains some grammatical errors (for example, Gayle
often mixes up "eg" and "ie"). In addition, many explanations would be much clearer with
an example.
- Both books are similar in length (about 300 pages), and their "non
technical" advice is very similar.
- Overall, "Exposed" is easier to read, but "Cracking" has more
content. Tough call.
There is also the good book "Algorithms For Interviews" by Adnan Aziz
and Amit Prakash (2010), which contains much harder questions,
focusing on clever algorithms and not on implementation details. Do
not attempt this book before mastering "Cracking" and/or "Exposed",
you will find it demoralizing! But it's probably worth trying some of
these harder problems, to see how "fancier" algorithms (like Dijkstra,
or max-flow min-cut, or dynamic programming) can be applied in
creative ways.