Preparing for a hiring process can be quite stressful. After all, one potentially wants the job and does not know what is upcoming. Any question is possible. So how do you prepare for such a task?
Of course, experience and the personal abilities matter the most. But there are some questions and scenarios that just require you to step back and have the basics ready on command. All the big companies will ask (at least introductory) questions like "what is complexity of the quick sort algorithm" or "which optimizations are practical for a search algorithm".
Luckily, these basics can be (re-)obtained (or practiced) very well. I just want to give two examples of books that I purchased.
The first one is Elements of Programming Interviews from Aziz, Lee, and Prakash. This is a great resource and very valuable. The authors write their code in C++. The examples are carefully chosen and superb. They also included some brain teasers and general guidelines. Finally, the book is perfectly looking - it was typeset in LaTeX using the Memoir class.
The second book is called Cracking the Coding Interview. I bought this one through a recommendation from a friend. The book did not catch me. It stays on the surface and seems like a "mass product" with fairly common examples. The code is written in Java. It may be well suited for completeness reasons, but if one only has limited money to spent - the previously mentioned book should be the right choice.
Books may not always be the answer. They are outdated quite fast and pushed to market in a rush. Sometimes simple online blogs or communities are at least as well suited to provide some insights. The following three websites do a good job in covering the preparation process for a coding interview.
On topcoder.com we find concrete problems to work on. The slow online editor supports live evaluation. It does not contain fancy features, but this is alright as companies such as Google would prefer a "raw" text editor to an IDE anyway (at least during the interview).
My favorite page is geeksforgeeks.org. The page hosts some example interviews provided by its community. Also we have a couple of popular problems with solutions drawn during real interviews. The page encourages redoing the problems and coming up with your own solution.
Finally, I've heard only good things about leetcode.com. I have no personal experience with this page, however, the coding interviews seem to be pretty well curated. Also it hosts a set of standard problems and a submission process to provide some evaluation. It may be a better alternative to Topcoder, which seems a little bit bloated and confusing at times.
Books
- Aziz, A. and Lee, T.-H. and Prakash, A., "Elements of Programming Interviews", ISBN 978-1-4792748-33
- McDowell, G.L., "Cracking the Coding Interview", ISBN 978-0-9847828-57