I recently completed my SDE-1 interview process at Amazon. The overall experience was intense yet rewarding. Here’s a detailed breakdown of all the rounds:
Note: This round was rescheduled twice.
1. OOPs Implementation Question
Given student data with fields: rollNo (alphanumeric and unique), marks, name, rank (not unique), etc.
Task:
My Approach:
I used two HashMaps:
rollNo to Student.rank to a list of Students.The interviewer was satisfied with the approach.
Follow-up:
2. Binary Tree – Count Nodes with Two Children
Problem: Count the number of nodes in a binary tree that have both left and right children.
My Approach: Implemented using post-order traversal (recursive).
Follow-up:
He asked me to solve it iteratively, but I was unable to implement the iterative version in time.
Note: This round was initially scheduled on some other date, but the interviewer didn’t show up and it was rescheduled.
1. Leadership Principle Question
Q: Tell me about a time when you were learning something that wasn’t part of your job. .
2. Follow-up:
Q: What did you like most about that technology?
3. String Compression Variant
Problem:
Given a string, replace each group of consecutive characters with the character and its count. If the count goes beyond 9, than start the counting again.
s = "aaabbc" → a3b2c1s = "aaaaaaaaaaabbbcc" → a9a2b3c2Status: Solved with an optimized solution.
4. Beautiful Nodes in a Graph
Problem:
Given an n x n adjacency matrix, find all beautiful nodes.
matrix[i][j] = 1 means node i is connected to node j.Status: Solved with correct and optimized solution.
1. Leadership Principle:
Q: Tell me about a time when you had to deep dive to solve a particular problem.
Cross-questions followed to test depth and clarity.
2. Leadership Principle:
Q: Tell me about a time when you received negative feedback and how you handled it.
More follow-up questions on this as well.
3. DSA – Longest Substring with All Distinct Characters
Problem: Given a string, return the length of the longest substring with all distinct characters.
Status: Solved with an optimized sliding window approach.
At the end of the third round, the interviewer said:
"Recruiter will reach out for next steps."
Which strongly indicates selection. 🎉
Hope this helps others preparing for Amazon!