Recently, I was able successfully to pass the Amazon Online Coding test. I was an amazing experience that pushed my mental strengths to the limit. In this blog, I am going to explain what did I do to successfully pass the test. Let’s start with the test structure.
The purpose of the online coding test is to identify candidates who may do well on the onsite interview. It measures the problem solving skills and coding skills of the applicant. Also it has some questions to measure you against Amazon Leadership Principals. You’d be taking the test on a online code pad tool. You can use most of the popular programming languages. You can go to the tool and get familiar with the features before attempting the exam.
Test has two coding questions. First question is easier than the second. You will have 90 mins to complete both questions. Once you’ve submitted the code, you will get some MCQ questions about Leadership Principals. These questions is not timed, you can take as much as time you like.
Let’s see how to prepare for the tests. Brush up your knowledge on basic data structures like Stack, Linked List, Queue, Heap, Binary Search Trees, Hash Tables and Graphs. Sorting and searching are the most popular questions in test. So brush up your knowledge on Merge Sort, Quick Sort, Heap Sort, Binary Search.
Tree traversals are also important. Read up on DFS and BFS. Cover all three traversal models pre Order, in Order and Post order. Study Prim’s and Dijkstra’s algorithms for graph traversal. Also read about Divide and Conquer and Dynamic Programming.
You usually asked to provide the time/memory complexity of your code. So study how to calculate it. Also try to remember time complexity of classical algorithms.
You could study by your self. But I highly recommend you to invest on Amazon best seller Cracking the Coding Interview: 189 Programming Questions and Solutions book.
This book covers algorithms, data structures needed for the test. It explains how to compute time and memory complexities. Very importantly it has 189 practice questions. Book is not cheap. But a sound investment considering that it will help to get to Amazon.
Looking for a free book??
If above book is too expensive, an alternative book is Coding Interview Questions. You can read this book for free for 30 days if you register for Amazon’s Kindle Unlimited Membership Plan’s free trial period. You don’t even have to have a Kindle. Just log in to read.amazon.com and start reading.
Practice Practice Practice
Practice is the key. Do as much as practice questions you can. Try the practice questions of the book if you have it. Also there are several online web sites (like Leetcode) which provide hundreds of practice algorithmic questions. Make the best use of them.
During the Exam
You can access the internet during the exam. You are allowed to use your own IDE. But the risk is if you couldn’t copy paste your code on time, you will loose everything.
Time is Precious
50% of the exam is about time management. Two questions are hard enough to make it difficult to finish both within 90 minutes. If the first question is the easier one, don’t waste too much time on it.
If you are running out of time, prioritize the important bits of the algorithm. For example, if you are going to implement a sort, you should prioritize the Comparator since it’s going to be to the core logic of the program. To have any chance to pass the interview, you should at least have something to show for, for both questions.
Write Good Code
This is the first time Amazon is going to see your code. So give the best first impression. Follow basics; use meaningful variable/method names, move the redundant code to functions. Try to create classes instead of using complex collections. Write comments where needed. Try to output the best industrial software you can.
Do not Brute Force
You may be tempted to solve problems by brute force. But this is highly dicoraged. Try to provide a optimal solution than the Brute Force. Having 60% completed code of the optimal solution is better than a 100% working code of the brute force solution.
After coding questions, you will have to answer a questionnaire which evaluates whether you are a good cultural fit for Amazon. Try to be your self and answer honestly. If you and company are not going to be a good match, it’s going to be a bad move for both the parties.
Don’t trust the tool too much save your work continuously as you progress. I took about 3 weeks to prepare my self for the coding test. Try to start early as possible.
2 thoughts on “How to Pass Amazon Online Coding Test”
Thanks for writing this. Very helpful.