Vishwanath Krishnamurthi's blog

A blog on Java EE, clean code, open source and TDD

How to prepare for an Amazon interview ?

with 5 comments

I joined Amazon a few months back. I did spend a few months on preparation. In this post, I’ll list out some resources that I liked and some tips. Hope that helps.

Divide the preparation into two parts – Theory and Code

Interview specific books are good to give you an idea on how the questions would be and get you started. But to be really confident and skillful, you’d also have to know a lot of theory and concepts behind. By theory I mean data structures, algorithm paradigms, complexity analysis techniques etc. Knowing the concepts helps you to analyze better and brainstorm for different ideas for solving the same problem. Present various ideas in the interview – that can only be good. Switch between these two modes of preparation every now and then.

Theory preparation:

There are a lot of great Moocs. You could use one or two reference books, but most of the theory could be learnt just by watching free videos online.

Coursera: Algorithms course, Princeton university by Robert Sedgewick (Part I and Part II )

Great course ! View as many videos as you can ! Starting from the basics, the author explains the must know algorithms and the concepts behind them. What’s great is, you’d start “appreciating algorithms” – one of the biggest motivating factors 🙂  And it’s far easier to watch videos than to read books, right ?

Book: Algorithms, 4th Edition by Robert Sedgewick

I liked the coursera course a lot. Almost everything in this book is explained by the videos in the course. This book became a very handy reference, when I wanted to learn the implementation details.

Coursera: Algorithms Design and Analysis, Part I and II, Stanford University

Great content, once again. Probably the most “lively” set of lectures in this list. Complements the Princeton course so well.

Book: Introduction to Algorithms, CLRS  

A classic – Used this more as a reference or to read certain parts not covered in “Algorithms, 4th Ed”

IIT Videos: Video lectures here

A good series of lectures – contains lectures on disk based data structures, dictionaries etc which are not covered in any other “mooc”s

MIT OCW : Video lectures here

Good lectures, lengthy though. I skipped the parts where “proofs” were derived. But watched them in general.

Code Preparation

Learning theory is good – but that’s not enough. Reading a lot of code is important.

GeeksforGeeks : Website link here

Contains lots and lots of problems and solutions. Also has “interview sets” where many have shared their interview experiences. The problems are really well organized. No book contains so many problems categorized under “dynamic programming” or “backtracking” etc.

Book: Elements of Programming Interview (EPI)

300+ problems and solutions – just what you’d want to get into the “problem solving” mode. The quality / standard of the questions are great. The problems are way tougher than the ones presented in “Cracking the Coding Interview” (book described below). I spent most of the problem solving from this book.

It’d be great to solve a problem in different ways right ? After going through most of the problems in this book, you’d be able to do just that.  Finishing this book cover to cover might not be possible. I might have done about 70% of this.

This book does not have lengthy explanations to each problem – only the gist is explained and the rest is left to you to “read the code” and understand – So you are made to read a lot of code and the book is small enough to carry around.

Comparing with CCTI:

  • Number of questions: More
  • Are questions tougher or simpler ? : Tougher
  • Lengthy explanations ? : No
  • Are questions more like actual interview questions: Not all of them are
  • What happens when you finish this book ? :  You’d be well prepared and confident

Book: Cracking the Coding Interview, 5th Ed (CCTI)

This book is easy to read compared to EPI. Each solution is explained in great detail. A lot of interview specific tips too.

Comparing with EPI

  • Number of questions: Lesser
  • Are questions tougher or simpler ? : Simpler
  • Lengthy explanations ? : Yes ! You’d love the book for how well the solutions are explained.
  • Are questions more like actual interview questions: Yes
  • What happens when you finish this book ? :  You’d be somewhat prepared and somewhat confident

Book: Coding Interviews

Certainly a good book. If you wish to go through an additional set of problems, here it is. The good thing about this book is, it provides “test cases” for each and every problem. Yes, you have to test the code that you write in the interviews. So you’d develop an idea for test cases reading this book.

Comparing with CCTI

  • Number of questions: Almost the same
  • Are questions tougher or simpler ? :  Almost the same level of toughness
  • Lengthy explanations ? :  More than EPI, lesser than CCTI
  • Are questions more like actual interview questions: Yes
  • What happens when you finish this book ? :  You’d be somewhat prepared and somewhat confident

Youtube videos: Suarabh School videos

Look for the algorithm specific playlists. Numerous problems – solved and explained. I liked these videos a lot.

What books did I skip ?

  • Algorithm Design Manual
  • Programing Pearls

These books are classics. I’ve got these books now and intend to read them sometime. But I don’t think they are essential from an interview preparation perspective.

Remember – The objective is certainly not to “know” all solutions. The objective should be to become “skillful” enough to arrive at one or more solutions.

How to get a call ?

Well, preparing for the interviews is just one part. Getting a call for an interview is a completely different story.

Two good books I’d recommend:

Well, Good luck !


Written by Vishwanath Krishnamurthi

March 15, 2014 at 8:50 pm

5 Responses

Subscribe to comments with RSS.

  1. comprehensive and useful


    March 16, 2014 at 3:23 pm

    • I have seen to the resources you have suggested! I will follow the thanq for our support!!!


      October 15, 2014 at 6:46 am

  2. Thanks for sharing this info. How much time could it take for this preparation? I know this is relative to learning appetite but still some idea on it could be useful.


    December 22, 2014 at 3:50 pm

  3. nice


    January 19, 2015 at 7:55 pm

  4. Vishwanth , i am having a problem with one of the questions in EPI can you explain the solution ?
    “A robot needs to travel along a path that includes several ascents and descents. When it goes up, it uses its battery to power the motor and when it descends, it recovers the energy which is stored in the battery. The battery recharging process is ideal: on descending, every Joule of gravitational potential enery converts to a Joule of electrical energy which is stored in the battery. The battery has a limited capacity and once it reaches this capacity, the energy generated in descending is lost.

    Design an algorithm that takes a sequence of n three-dimensional coordinates to be traversed, and returns the minimum battery capacity needed to complete the journey. The robot begins with the battery fully charged.”


    May 2, 2015 at 6:30 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: