Amazon (AWS) | SDE-2 | Phone Screen
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-02-20Added By Anonymous
Source: Link
YOE: 5+ years
Position: SDE 2
Location: Ireland
OA:
1.Given the number of movie series watched, find the minimum subarray that includes series1 and series2.
2.The minimum subarray is counted based on the number of distinct elements in it.
3.Example:
4.s1 = 1
5.s2 = 2
6.watched = [1, 3, 2, 1, 4]
7.Output: [2, 1]
8.Given an array, find the maximum possible number after performing a specific operation:
9.Remove the smallest element from the array.
10.Replace it with the sum of its adjacent elements (idx-1 + idx+1).
11.Example:
12.charge = [-2, 4, 3, -2, 1]
13.Step 1: Remove idx 0 (-2) → [4, 3, -2, 1]
14.Step 2: Remove idx 2 (-2) → [4, 4]
15.Step 3: Remove idx 1 (4) → [4]
Phone Screen:
1.Leadership Principles: Customer Satisfaction & Dealing with Setbacks (30 min)
2.Design a Task Scheduler to append tasks and fetch them based on priority (30 min)
3.Example:
1class Task:
2 def __init__(self, id, priority, code):
3 self.id = id
4 self.priority = priority
5 self.code = code
6class TaskScheduler:
7 def add(task): # Add a task
8 def fetch():
9 # Fetch task with the highest priorityMy Take:
•I prepared well and performed well too. For the Leadership Principles (LP) round, I structured my responses using the STAR method and covered key principles like Customer Obsession, Deep Dive, Being Right a Lot, and Delivering Results.
•For the OA, I solved the first problem using the minimum sliding window approach. The second problem, I tackled using an indexed heap, but I hit a time limit—15/20 test cases passed.
•For the phone screen, I solved the problem in 10 minutes, starting with a brute-force approach (O(n² log n)) and optimizing it to O(n log n) worst case. I covered edge cases, discussed bottlenecks, and included type annotations in my code.(May be could have used BST )
•Weirdly, the interviewer mentioned the recruiter’s name and said they would update me on the next steps. But today, I received a rejection email. Honestly, I feel like giving up on FAANG, but it still feels like the only way out of my current situation.