AMAZON | SDE1 | 2+ yr Exp

amazon logo
amazon
SDE I2 yearsOffer
October 17, 202122 reads

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.

Full Experience

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.

Interview Questions (8)

Q1
Cheapest Flights Within K Stops
Data Structures & AlgorithmsMedium

There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with cost pricei.

You are also given three integers src, dst, and k. Return the cheapest price from src to dst with at most k stops. 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.

Q2
Critical Connections in a Network
Data Structures & AlgorithmsHard

There are n servers numbered from 0 to n - 1 connected by undirected server-to-server connections forming a network where connections[i] = [a, b] represents a connection between servers a and b. 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.

Q3
Replace Node with Left Subtree Sum
Data Structures & AlgorithmsMedium

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.

Q4
Next Greater Element II
Data Structures & AlgorithmsMedium

Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums.

The next greater number of a number x is 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 -1 for this number.

Q5
Maximum Sum of K Elements from Ends of Array
Data Structures & AlgorithmsMedium

Given an array of integers arr and an integer k, you have to choose exactly k elements. These k elements 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.

Q6
Remove Duplicates from String (Maintain Order)
Data Structures & AlgorithmsEasy

Given a string, remove all duplicate characters from it while maintaining the original relative order of the remaining characters.

Q7
Meeting Rooms II
Data Structures & AlgorithmsMedium

Given an array of meeting time intervals intervals where intervals[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.

Q8
Kth Missing Positive Number
Data Structures & AlgorithmsEasy

Given an array arr of positive integers sorted in a strictly increasing order, and an integer k.

Return the kth positive integer that is missing from this array.

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!