AMAZON | SDE1 | 2+ yr Exp
- Result
- Offer
- Experience
- 2 years
- Posted
- 17 Oct 2021
Summary
I successfully completed a five-round interview process for an SDE1 position at Amazon, which included multiple coding challenges and behavioral questions, culminating in a job offer.
How it went
I recently went through an extensive interview process for an SDE1 role at Amazon, which comprised five distinct rounds culminating in a job offer. My journey began with an online coding test where I successfully solved two algorithmic problems related to network optimization.
Following this, I was invited for virtual interviews which were scheduled on different days. The second round involved two more coding challenges – one on binary tree manipulation and another on finding the next greater element in an array – alongside a discussion on Amazon's leadership principles. I was happy with my time and space complexity analysis for both problems.
The third round, held on the same day as the second, started with several behavioral questions based on leadership principles, followed by a coding problem requiring me to maximize the sum of k elements chosen from the ends of an array. I recognized it as a sliding window problem and implemented a two-pointer approach effectively.
The fourth round was a managerial discussion, primarily focused on leadership principles, but also included a quick coding question about removing duplicates from a string while maintaining order. I solved this using a StringBuilder and HashSet.
Finally, the fifth coding round presented two more algorithm problems: one on meeting rooms and another on finding the kth missing positive number. For the meeting rooms problem, I initially used two min-heaps and later discussed optimizing space with one heap. For the missing number problem, I started with a linear approach as requested and then moved to a binary search solution.
Throughout these rounds, I focused on clearly explaining my thought process, optimizing my solutions, and demonstrating my problem-solving skills, which ultimately led to receiving an acceptance mail from Amazon HR one week after my last interview.
Questions asked (8)
- 01
Cheapest Flights Within K Stops
Data Structures & Algorithms · Medium
Open the problemThere are
ncities connected by some number of flights. You are given an arrayflightswhereflights[i] = [fromi, toi, pricei]indicates that there is a flight from cityfromito citytoiwith costpricei.
You are also given three integerssrc,dst, andk. Return the cheapest price fromsrctodstwith at mostkstops. If there is no such route, return-1.
The problem was contextualized as Amazon having a retail/transport business, asking how to calculate the cheapest flights within certain constraints. - 02
Critical Connections in a Network
Data Structures & Algorithms · Hard
Open the problemThere are
nservers numbered from0ton - 1connected by undirected server-to-serverconnectionsforming a network whereconnections[i] = [a, b]represents a connection between serversaandb. Any server can reach any other server directly or indirectly through the network.
A critical connection is a connection that, if removed, will make some server or group of servers unable to reach some other server or group of servers.
Return all critical connections in the network in any order.
The problem was contextualized as Amazon having a retail/transport business, asking how to identify important connections within their network. - 03
Replace Node with Left Subtree Sum
Data Structures & Algorithms · Medium
Given a binary tree, replace each node's value with the sum of all node values in its left subtree. If a node has no left subtree, its value should be replaced with 0.
- 04
Next Greater Element II
Data Structures & Algorithms · Medium
Open the problemGiven a circular integer array
nums(i.e., the next element ofnums[nums.length - 1]isnums[0]), return the next greater number for every element innums.
The next greater number of a numberxis the first greater number to its traversing order next in the array, which means you could search in a circular way to find its next greater number. If it doesn't exist, return-1for this number. - 05
Maximum Sum of K Elements from Ends of Array
Data Structures & Algorithms · Medium
Given an array of integers
arrand an integerk, you have to choose exactlykelements. Thesekelements must be chosen either from the beginning of the array, the end of the array, or a combination of both (some from the beginning and some from the end). Your goal is to maximize their sum. - 06
Remove Duplicates from String (Maintain Order)
Data Structures & Algorithms · Easy
Given a string, remove all duplicate characters from it while maintaining the original relative order of the remaining characters.
- 07
Meeting Rooms II
Data Structures & Algorithms · Medium
Open the problemGiven an array of meeting time intervals
intervalswhereintervals[i] = [starti, endi], return the minimum number of conference rooms required.
For example, given[[0, 30],[5, 10],[15, 20]], you would need 2 rooms. - 08
Kth Missing Positive Number
Data Structures & Algorithms · Easy
Open the problemGiven an array
arrof positive integers sorted in a strictly increasing order, and an integerk.
Return thekth positive integer that is missing from this array.