Amazon Interview Experience | Set 359 (On-Campus)

• Difficulty Level : Expert
• Last Updated : 10 Jul, 2019

20 MCQs mixed with simple Quants, logical, other Technical CS concepts (TOC, DS, DBMS, NETWORKS)

2 Programming questions (I solved both)

Use max (previous element’s exclusive + arr[i]) idea. See Geeks For Geeks or Tushar Roy video if needed.

1. Profit sort (Find no. of elements in the given range)

(Did it in

o(n) for each query, by normal for loop traversal

o(log(n)) for each query, by sorting and using Binary Search we can pass TLE (Time Limit Error) then finally, I solved it using Hashing and then do like counting sort algorithm so

o(1) for each query (Because question had maximum space complexity as 256MB so it won’t be a problem) MOST OPTIMAL ONE.

FACE TO FACE INTERVIEWS:

4 Totally = 3 technical, 1 technical + Bar raiser rounds

First Round: (1 hr.)

• How was your placement preparation?
• How were your previous company interviews?
• Which DS you are comfortable? (Tricky for some panels asked other DS rather)
• Merge 2 sorted linked list into sorted one (Optimize code further)
• Write code for the same by covering All Edge cases (Avoid wild pointers)
• A modified DFS with recursion question
• You want to ask any questions?

Second Round: (40 min)

• What’s your passion in technologies?
• Write code to connect Binary Tree leaves nodes like a Doubly linked list (Use Post Order or any Traversal and keep track of previous nodes and check if it’s leaf node. Note: Avoid Dangling or wild pointers while writing code, initialize variables to NULL)
• You want to ask any questions?

Third Round: (1:20 hrs.)

(PROBLEM SOLVING + kind of like STRESS INTERVIEW)

• U have 2n players, they compete with each other, each player has a rank, what can you tell about the winner?

(Question was same as this, I asked many clarifications (received stress then answers) and tried Graphs, Sorting players based on Ranking he said it’s not required, demanded efficient one then I solved using Tournament Trees (2n is the clue to use tournament tree) He was very satisfied.

• Write a code to convert a palindrome number to next immediate higher number and it’s a palindrome too e.g. 1221=> 1331 (Think about edge cases like 99, 191 before coding, that will reduce no. of strikes on paper, in case of 9, u have to propagate carry to next elements)

• What is Scheduling algorithm? What is used in ur PC? (Multiple feedback queue) he didn’t accept Round robin.

Rapid Fire Round:

(these were challenging as he expected to answer faster!)

• Why should I hire you?
• What’s the book you read recently?
• What is your biggest mistake?
• What is your weakness? How you overcame it?
• What do you want to change in Amazon?
• Why your ICICI project was rejected for next level?

Final Round (1hr) test BASIC CS concepts more

• First received a compliment from interviewer for my fast coding skill on paper (previous panels review).
• Do you like android or iOS? Me: Android! Then take your phone write a code to simulate Android pattern locking, took my phone and understood what patterns are possible then

(I solved and coded it using recursion and backtracking)

Matrix can be N x N Pattern Box.

2 sub-problems:

1. Check if given pattern is possible or not (Use ANGLE 90 or 180)

2. Print all possible patterns you can make with given length and starting point

Edges cases should be covered properly!

• Why you have used NoSQL in your project?
• Why you can’t use MySQL? Where it is used?

(Explained ACID properties using BookMyShow app exactly)

• What and all will happen when you boot up your PC? (Tell from BIOS stage)
• What is kernel?

I explained everything I knew, finally I explained Android Phone Kernel too. He was very impressed and was like stopping further simple questions.

• How PC is executing things? Program counter. Explained more.
• How variables are stored? Depends, Register or Main Memory. Explained more.
• Why main memory or register when you have secondary memory?
• How program is made to run (steps). Explained like C program to Assembly language to binary codes.
• Program vs Process (I tried to explain threads, he stopped me then below one)
• Design a DS question

U have a dictionary of words (Not necessarily in order given in our English dictionary)

How will u search for word (Used topological sort and explained why and how it works he was convinced)

• Difference between Abstraction and Encapsulation?
• Why we should use ER diagram? (I gave a lead to Normalization thus next questions)
• Then again why Normalization?
• Give examples of anomalies if we don’t normalize, I explained with an example database.
• How threads can communicate? Files, Pipes etc.
• Have you attended any coding contests?
• U want to ask Any questions?

It was all done in one day. I thank Geeks for Geeks so much for helping me for my placement preparations. It was and is very helpful!!

f you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.