Open In App

Amazon Interview Experience for SDE Internship (Off-Campus) 2023

Last Updated : 27 Sep, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

OA:

It was on a hacker rank platform where I had to solve 2 questions in 90 minutes. The questions were new, and I would say they were at the LeetCode medium level.

INTERVIEW:

My interview was based on the STAR pattern. To prepare for the interview I read about Amazon’s leadership principles and brushed up my projects. But in my case, they were of no use. There were 2 interviewers. After everyone’s introduction. I was given 2 problems to solve. Solving problems took all the time so we didn’t have time to talk at last I asked him a few questions about his experience and the problem he gave me.

Problem 1

Given an array consisting of 0 and 1 where 0 is an empty seat and 1 is a non-empty seat, we have to place a person such that he should sit from the maximum distance from his adjacent person and we have to return the distance.

Eg arr = {1,0,0,0,1,0,1} here we place the person at the 2nd index from which we get the distance as 2.

I was able to discuss the approach and code the solution.

Problem 2

It was extended version of problem one here we had the seat arrangement in 2D.

arr = {{1,0,1}

{0,0,0}

{1,0,1}}

we have to use Manhattan distance to calculate the distance i.e. D = |i1 – i2| + |j1 – j2|.

I gave him a brute force approach at first which had a terrible time complexity. then i gave him an n^4 approach for which i wrote a code, i used BFS and DP in that, although my code was correct but the interviewer said that it is not the optimal solution. I asked him for a some hint but the time was over he moved towards concluding the interview. As a hint he told me that my approach was correct but I’m not using DP efficiently.

Result:

3 days later i got a mail, I was selected for the SDE Intern role at Amazon.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads