Amazon last 6 months DSA question compilation
Summary
Applied for SDE-2 role at Amazon. Focused on DSA preparation but faced challenges in LLD round due to lack of backend system design knowledge. Overall, the interview process was intense and provided a comprehensive overview of the company's technical rigor.
Full Experience
I recently gave an SDE-2 interview at Amazon, and this is the list of questions I found on LeetCode Discuss that I used for preparation. Unfortunately, I was rejected in the LLD round because the interviewer focused on backend LLD, while I had prepared only for mobile development LLD. I hope this will be useful for everyone who has an interview scheduled.
Interview Questions (16)
Bus Routes
Given a list of bus routes where each route has multiple stops, find the minimum number of buses to take to get from a source to a destination stop.
Course Schedule II
Given a list of courses and their prerequisites, find an order to take the courses such that all prerequisites are satisfied.
Detect Cycles In 2D Grid
Determine if there is a cycle in a 2D grid where each cell represents a node connected to its adjacent cells.
Evaluate Division
Given equations in the form of a/b = k, determine the value of a given query like a/c.
Find Eventual Safe States
Determine which nodes in a directed graph are safe states, meaning there is no cycle and no path leads to a cycle.
Keys And Rooms
Determine if all rooms in a building can be unlocked starting from room 0, given that each room contains keys to other rooms.
Max Consecutive Ones III
Find the maximum number of consecutive 1s in a binary array you can get by flipping at most k 0s to 1s.
Minimum Operations To Reduce X To Zero
Find the minimum number of operations to reduce a number X to zero by either subtracting a number from the array or subtracting 1 from X.
Magnetic Force Between Two Balls
Calculate the maximum possible minimum distance between two balls placed in a line of positions, given certain constraints on their placement.
Search In Rotated Sorted Array
Find the index of a target element in a sorted array that has been rotated at some pivot point.
Longest Valid Parentheses
Find the length of the longest valid parentheses substring in a given string.
Remove K Digits
Remove k digits from a number represented as a string to make the resulting number as small as possible.
Best Time To Buy And Sell Stock II
Find the maximum profit that can be achieved by buying and selling stocks on different days, with the constraint that you can only hold one stock at a time.
Merge K Sorted Lists
Merge k sorted linked lists into one sorted list.
Integer To English Words
Convert an integer to its English words representation.
Merge Intervals
Preparation Tips
Prepared extensively for DSA topics, focusing on graph algorithms, system design, arrays, trees, dynamic programming, and other key areas. Used LeetCode Discuss to compile a list of problems for targeted practice.