Amazon SDE Intern(6m) Interview Experience

Amazon logo
Amazon
SDE InternnullWaitlisted
November 2, 202545 reads

Summary

Had a successful interview with Amazon for SDE Intern role. Faced two medium-level graph problems, solved them using DFS and cycle detection techniques. Received a waitlist outcome.

Full Experience

Hey everyone! Just wanted to share my recent Amazon interview experience. Hope this helps someone preparing for their interviews.

How I got the interview:
Got the opportunity through HackOn platform.

Interview Process:
- 1 Online Assessment
- 1 Technical Round (1 hour)

The Interview:
Started with quick introductions, talked a bit about my background and projects. Then the interviewer jumped straight into the problems.

Problem 1: Pacific Atlantic Water Flow
The classic one - https://leetcode.com/problems/pacific-atlantic-water-flow/
Basically given a matrix representing heights, need to find cells from which water can flow to both Pacific ocean (top and left edges) and Atlantic ocean (bottom and right edges). Water flows to cells with equal or lower height.

I solved it using DFS from both oceans. Started from all Pacific border cells, marked which cells are reachable. Then did the same for Atlantic. Finally returned the intersection.

Took me around 20-25 mins to code and explain. Interviewer asked about time complexity which is O(m*n).

Problem 2: Team Dominance Order
Given a 2D array where each row has 2 columns - [teamA, teamB] meaning teamA is dominant over teamB. Need to check if there exists a valid dominance order.

For example:

[[1,2], [2,3], [3,4]] -> true (order exists: 1->2->3->4)

[[1,2], [2,3], [3,1]] -> false (cycle!)

Initially I was confused but then realized it's basically cycle detection in directed graph. Built the graph with adjacency list, then applied topological sort using Kahn's algorithm. If we can process all nodes means no cycle, so valid order exists.

Interviewer seemed satisfied with the approach. Discussed edge cases like what if there are disconnected components etc.

similar question - https://leetcode.com/problems/course-schedule/

Overall Experience:
The interviewer was very calm and composed, gave hints when needed. Didn't feel too pressured. Both questions were standard medium level graph problems.

My advice - Verbalize your thought process, don't just start coding silently.

Verdict: Waitlisted

Interview Questions (2)

Q1
Pacific Atlantic Water Flow
Data Structures & AlgorithmsMedium

Given a matrix representing heights, find cells from which water can flow to both Pacific ocean (top and left edges) and Atlantic ocean (bottom and right edges). Water flows to cells with equal or lower height.

Q2
Team Dominance Order
Data Structures & AlgorithmsMedium

Given a 2D array where each row has 2 columns - [teamA, teamB] meaning teamA is dominant over teamB. Need to check if there exists a valid dominance order.

Preparation Tips

Prepared by practicing standard LeetCode medium level graph problems. Focused on understanding DFS and cycle detection techniques.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!