Related Articles

# Amazon Interview Experience for SDE-1

• Difficulty Level : Medium
• Last Updated : 20 Aug, 2021

Hi All, Initially, I have found the Amazon SDE job requirement on Linked In then I applied on the Amazon job portal for the same. I got an email for round one after two weeks.

Round 1: It was conducted online and needs to implement the coding on the HackerRank platform. There are 3 sections of the assessment.

1. Coding challenge (2 scenarios) and Coding approach (elaborate why you code the way you do) – 105 minutes
2. Workstyle survey – 15 minutes
3. Feedback survey – 5 minutes

1. Given n number of sorted files, the task is to find the minimum computations done to reach the Optimal Merge Pattern.
```
Sample Input:

n = 6, size = {2, 3, 4, 5, 6, 7}

Sample Output :

68

Approach: This can be solved by using minimum heap.

```
2. Given a matrix with values 0 (trenches), 1 (flat), and 9 (obstacle) you have to find the minimum distance to reach 9 (obstacle). If not possible then return -1. The demolition robot must start at the top left corner of the matrix, which is always flat and can move on the block up, down, right, left. The demolition robot cannot enter 0 trenches and cannot leave the matrix.
```
Sample Input :

[1, 0, 0],

[1, 0, 0],

[1, 9, 1]]

Sample Output :

3

Approach : This can be solved by using BFS or DFS.

```

All test cases passed for both so that I expected for the second round. After 15-20 days I got a mail from HR for an Amazon Chime Interview. There will be 2 rounds on that day only.

Round 2:

Here I took more time to solve this problem and approached the brute force approach. The interviewer didn’t ask for an efficient approach since I have crossed the time limit.

Round 3: