PlaceKode with Hardik Khandelwal placed at Amazon

Uthaan IIITM
Uthaan
Published in
7 min readSep 7, 2019

Uthaan, the Journalism and Recreational Club of Atal Bihari Vajpayee Indian Institute of Information Technology and Management, Gwalior presents its new series, PlaceKode which informs students about the interview procedure of major companies. Here in conversation with us is Hardik Khandelwal placed at Amazon

Amazon is now the world’s most valuable company and has knocked Google off the top spot as the best place to work in the world. How does it feel to be a part of such an organization and what was your interview procedure?

Amazon is something I really wanted to be a part of and I was preparing hard for it. Usually, all tech giants conduct multiple rounds in an interview. In my case, I faced four technical rounds after an online round.

Usually, they don’t ask difficult questions, they ask generic questions because they want to evaluate how much in-depth knowledge of data structures and algorithms you have. Wherever you get stuck, you should think out loud because they want to know how you are thinking. This was really helpful for me in my first round. Whenever you get stuck you should ask for a hint and should be able to grab that hint, and most importantly he would try to explain the problem to you, so before rushing to the solution, you should understand the problem, discuss the solution and then write it down.

How long was this entire interview procedure?

The online part which can be taken as the 0th round was held before which was the preliminary round. On the day of the interview, my first round started at 10:00 am which continued till 2:00 p.m. Then the second round started at 2:30 following lunch. After one round, I had barely stepped out of the room when I was called for the next one (laughs). So in my case, the final three rounds happened in succession. In short, it was for the entire day.

What was your mindset before going through the interview procedure?

One day before the interview, I faced rejection from a company. I had a very good interview and it was a great company as well and it so happened that they had to choose between two students, and they chose one of my batch mates, who was really deserving. Amazon was the company I dreamed of being in and worked a lot for achieving this dream. For me, anxiety is something that deteriorates my performance, so I made a promise to myself that I just had 12 hours left and in these 12 hours I was going to do my best.

So I was confident, I was stressed, but I kept myself calm by keeping in mind that I was going to do my best.

What do you think was the interviewer’s mindset while he was taking your interview?

The interviewer is not there to threaten you, they always try to help you out wherever they can. They are there to assess you in certain things. In three out of four rounds, I found that the interviewers were comforting and began the round with good greetings followed by some conversation. I found that they were putting me at ease so that I could perform the best I could.

What were the questions asked during the technical rounds?

1.Online Round

An online written round where the questions were pretty easy but fundamental on Data Structures, Algorithms, Operating Systems. Apart from that, there were multiple MCQ questions revolving around C++ which were of intermediate level. There were two coding questions. Firstly I was given a Caesar Cipher and I had to decipher it which is a simple implementation based modular arithmetic question and the other was to write a program to find the solutions of a linear equation in one variable.

Caesar Cipher- https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/

Solution of Linear Equation in One Variable- https://www.geeksforgeeks.org/solve-the-linear-equation-of-single-variable/

2. Technical Round-1

First was a standard interview question of cloning a linked list using random pointers. The second question was that I was given an array and I had to always return a random value from the array where each number had an equal probability of getting selected.

Cloning a Linked List using Random Pointers- https://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/

Random Value from Array- https://www.geeksforgeeks.org/select-a-random-number-from-stream-with-o1-space/

3. Technical Round-2

The first was the k-th largest element in Binary Search Tree and the second was designing a LRU cache.

K-th largest element in a Binary Search Tree- https://www.geeksforgeeks.org/kth-largest-element-in-bst-when-modification-to-bst-is-not-allowed/

LRU Cache- https://www.geeksforgeeks.org/lru-cache-implementation/

4. Technical Round-3

The first question was that given a continuously running stream of numbers and I had to find the minimum number of subsets of size two and three which are divisible by three.

The second question was also a good one where I was given k non- decreasing streams of integers and asked to design an iterator for combined stream where the combined stream is also in non-decreasing order. I had to implement two functions, hasNext() and next(). This problem is a variation of merge k sorted linked lists. In this question ,special attention has to be paid on what if stream is empty initially and then some elements came along.

Subsets of size 2 and 3 divisible by 3- https://www.geeksforgeeks.org/number-groups-sizes-two-three-divisible-3/

Merging k sorted linked lists- https://www.geeksforgeeks.org/merge-k-sorted-linked-lists/

5. Technical Round-4

The fourth round included questions about operating systems, scheduling algorithms, synchronization and all this was followed by two coding questions.

The first was to find the k-th largest element in an unsorted array in O(n) time and the second was that I had to design a data structure that performed search, insert, delete and get random functions in O(1) time.

K-th largest element in an unsorted array- https://www.geeksforgeeks.org/kth-smallestlargest-element-unsorted-array/

Data Structure with functions in O(1) time-https://www.geeksforgeeks.org/design-a-data-structure-that-supports-insert-delete-search-and-getrandom-in-constant-time/

On average, how much time did you get for solving technical questions?

Usually, we get 15–20 min for a question but if you get stuck somewhere, they may allow you some extra time but you should practice writing code on paper when preparing for interviews.

While you were working on the question asked, what were the interviewers doing?

They seem to be constantly writing something on their Mac-books even when I was doing nothing and appeared to be observing each and everything. I found them quite intrigued by the way I was thinking about the problem. They noticed each thing, whether I was dealing with a dry run of my code, if I abruptly started working on a problem without thinking of it or how I was writing code and whether it was modular or not.

You have encountered 4 technical rounds during your interview. How to prepare for these rounds?

Preparation isn’t a last moment thing. It is a step-by-step process and the preparation depends upon the time domain you have. I’d been actively involved in data structures and algorithmic coding, and before giving an interview for Amazon I had prior knowledge of what type of questions were usually asked by the interviewer as I used platforms such as Leetcode and GeeksforGeeks. I also read many interview experiences which gave me an insight into such interviews. If you have gone through your subjects, have an intuitive knowledge of what things are, how things are, and then 3–4 months are enough for an interview.

At last, do you have any tips for juniors?

Stop seeking for advice, to be quite honest. Do stuff which your heart tells you to do. The initial days are like the most beautiful days of the college as nobody knows you initially. So just explore yourself and look where your interest lies. You will hardly get time after the initial 3–4 months of your college time to explore your passion. You’ll get enough time for studies so just start living your life. Know that pointer is important but skills are at par with your pointer. Don’t be the guy who sits in the corner of the room and does nothing. This is so because you will get to know a lot from your friends than anybody else.

Also, know that there are two phases to the development of any skill. The first one is the fascinating part when you have just begun learning and started making some small projects.

The boring part comes next when most of us start giving up. Suppose I’m learning some skill and don’t find myself advancing in it, I end up giving up learning that skill.

Students should give at least 3–4 months of their time, and start utilizing those skills, just do something using them. For me learning is not just reading books, it’s about implementing it on a project, analyzing what I lack, and then trying to enhance that skill.

Interviewed by: Shrey Gupta and Anirudh Gautam

Photographed by: Saurabh Giri and Himanshu Ruhela

@GeeksforGeeks, Some rights reserved

--

--

Uthaan IIITM
Uthaan
Editor for

Uthaan is the Journalism and Recreational Club of Atal Bihari Vajpayee Indian Institute of Information Technology and Management (IIITM) Gwalior.