# Amazon Interview Experience for SDE-1

Today we will share with you the interview experience of a candidate who applied at Amazon for SDE-1 Position.

## Round 1: Coding round

Online coding assessment consists of 2 sections
**MCQs: 28 questions with no negative marking**
The questions had code snippets based questions, OOP and OS based questions. C basics should be strong.

**Coding: 2 coding questions**
They have a pool of about 20 questions from which they give 2 random questions.

**Ques 1)** Given n dice each with m faces, numbered from 1 to m, find the number of ways to get sum X. X is the summation of values on each face when all the dice are thrown.

**Ques 2)** Given a starting and ending time of events and only 1 event can take place at a time, print the maximum number of events that can take place. (Hint: Sort on the basis of start time and take a greedy approach)

## Round 2(Face to Face Interview)

**Ques 1)** Print Nodes in Top View of Binary Tree

I started with a level order traversal approach, then he moved on and asked to do the same with a preorder traversal. I had used a map to store the nodes and then print them after the complete traversal but then he asked me to improve the print operation and for that I used an unordered_map and a min index for the complete traversal. Then he asked me for the changes to make it a bottom view.

He went onto ask a **few concepts of Operating Systems like Process, Threads, deadlocks and Scheduling**.

## Round 3(Face to Face Interview)

**Ques 1)** K’th Largest element in BST using constant extra space
He questioned about the approach and tried to dig if I had seen such a question earlier.

**Ques 2)** Largest subset of rectangles such that no rectangle fit in any other rectangle
It was a modified version of the question(Just give the biggest element in the subset).
He then asked me about the strongest point on my resume and discussed deeply on the topic for about 20 mins.

## Round 4(Face to Face Interview)

**Ques 1)** Given an array of R and C, where R represents a rabbit at that location and C represents a carrot at that location and an integer D, a rabbit can eat a maximum of 1 carrot within the range D. Output the maximum number of carrots that could be eaten.
I gave a solution of O(n+d) but he made me improve it to O(n).

## Round 5(Face to Face Interview)

**Ques)** Number of palindromic paths in a matrix
The interviewer helped out a bit though. Asked a few minor things from the resume. He then relaxed the environment and asked about my hobbies.

In all the interviews they started by asking the approach and at the end we had to finally code up the problem.

### Result : Converted.

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.
Learn more at  [Placewit](https://placewit.com/) . Follow us on  [Instagram](https://www.instagram.com/placewit.prep/)  and  [Facebook](https://www.facebook.com/placewit/)  for daily learning.
