Hi,
I’ve compiled a list of all the questions asked by Amazon over the last six months for the SDE-2 position. I went through various interview experiences and compiled this list based on them.
I thought it might be useful to others preparing for the role, so I’m sharing it here. Hope it helps!
Link to Part 2- https://leetcode.com/discuss/post/8519184/questions-asked-by-amazon-in-past-6-mont-ya1z/
Link to Part 3- https://leetcode.com/discuss/post/8519189/questions-asked-by-amazon-in-past-6-mont-7wjn/
Tell me about a time you used Generative AI to automate or streamline a workflow.
Search an Element in a Sorted Rotated Array. Given a sorted array that has been rotated at some pivot point, search for a target element and return its index. Return -1 if not found.
How do you be a compitent software engineer in this era of Gen AI?
Design HLD (30 mins) for device backup scheduler and restore
Should backup device settings, files, media, etc
Restore on new devices
Unorthodox question around String Manipulation to find next palindromic time of given time "HH:MM". (MEDIUM)
Variation to find kth smallest sum of integers in row wise sorted m*n matrix . Only pick 1 element from each row (HARD)
Design and implement Meeting Room Scheduler.
Aggressive cows
https://leetcode.com/problems/find-median-from-data-stream/
Design a notification router for an ecommerce website
The user should have a preferred channel (EMAIL, SMS, PUSH)
Notification has a priority attribute (URGENT, NORMAL)
If the notification is urgent, it should be sent to all channels otherwise it should only be sent to the user's preferred channel.
The notification handlers need not to be implemented, only routing logic was needed.
Find unique permutations of a given string - For example, s = "xxyy"
First permutation = "xxyy"
Second permutation = "xxyy" -> Swap the 0th and 1st index "x" characters
But the output should contain "xxyy" only once. I had to return the list containing all the unique permutations
3Sum closest
Number of Islands II
Design: Google Docs (Collaborative Document Editing)
Key areas discussed:
• Real-time collaboration
o Operational Transformation (OT) vs CRDTs for conflict resolution
o WebSocket connections for low-latency sync
• Storage and versioning
o Delta-based storage for document history
o Snapshot + diff strategy for efficient retrieval
• Scalability — sharding by document ID, regional replication
• Presence indicators (who's editing what, cursor positions)
• Permissions and access control model
Design: Uber (Ride-Hailing System)
Key areas discussed:
• Class design — Rider, Driver, Trip, Payment, Location entities
• Trip state machine: requested → accepted → in_progress → completed / cancelled
• Driver matching algorithm — geospatial indexing (quadtree / geohash)
• Surge pricing logic and fare calculation service
• Payment service integration — idempotency, retries, failure handling
• API design — REST endpoints for booking, tracking, and cancellation
https://leetcode.com/problems/maximum-sum-bst-in-binary-tree/
https://leetcode.com/problems/reorganize-string/
Amazon receives transfer notifications whenever money moves between accounts.
Transfers form a chain, for example:
A → B → C → D
Input is provided as pairs:
[A, B]
meaning money moved from A to B.
Task:
Find:
• Initial source account
• Final destination account
Example:
numberOfTransfers = 3
transferList = [
(222, 111),
(111, 333),
(444, 222)
]
Output:
start = 444
end = 333
Explanation:
444 → 222 → 111 → 333
Design Amazon Locker System
Requirements discussed:
• Delivery driver deposits package
• Customer receives code
• Customer unlocks locker using code
• Locker allocation
• OTP/code validation
• Expiry handling
• Multiple locker sizes
• Scalability
• Availability
• Failure handling
Topics interviewer focused on:
• API design
• Database schema
• Concurrency handling
• Distributed locking
• Scalability
• Performance optimization
• Notification flow
• State transitions
Secure the Network by Disconnecting One Facility Center
A company has a network of Facility Centers (FCs) represented as a graph. Some FCs are compromised. If a compromised FC is connected to other FCs, the compromise spreads to all directly or indirectly connected nodes. You are allowed to disconnect exactly one compromised FC. Find which FC to remove such that the maximum number of clean FCs are saved. (If multiple FCs save the same number of nodes, return the FC with the smallest ID).
• Similar to: Minimize Malware Spread
Key Discussion Areas:
• Connected components
• DFS / Union Find
• Edge cases and constraints
• Time and Space Complexity
Design a Shipping Cost Calculator. Design a system to calculate shipping costs based on multiple dynamic conditions, including weight, distance, delivery type, priority shipping, region-based pricing, and special handling.
Given an array of delivery times, output the median of all values seen so far after each new delivery time arrives.
Input: [5, 17, 100, 11]
Output: [5, 5, 17, 11]
Approach: Solved using the Two Heaps pattern (Max-Heap and Min-Heap).
Given values in houses arranged in a line, find the maximum value that can be stolen without robbing two adjacent houses.
Input: [6, 7, 1, 3, 8, 2, 4]
Output: 19
Design the core architecture for a food delivery platform like Zomato.
Key Discussion Areas:
• Restaurant onboarding & Menu management
• Search & Discovery
• Order placement & Payments
• Delivery assignment & Real-time tracking
• Notifications
Employee Ratings Management System
A company maintains ratings for employees and needs to process operations in real time.
Operations:
1 x : Add an employee with rating x.
2 : Print the highest rating AND the index of the employee having the highest rating (If multiple employees have the same highest rating, return the first occurrence).
3 i : Delete the employee at index i (Note: Indices shift after deletion).
Challenge: Designing an efficient data structure supporting Insert, Delete-by-index, and Query-max + first-occurrence simultaneously.
https://leetcode.com/problems/binary-tree-cameras/description/
Given a string s, remove duplicate letters so every letter appears exactly once. Remove Duplicate Letters
BUT with a twist.
Original LC 316 asks for:
smallest lexicographical
Amazon changed it to:
largest lexicographical
That means same monotonic stack pattern, but reverse comparison logic.
Return the largest lexicographical possible result.
given the n sorted list and merge them.
given a list of Nodes in a N-ary tree, and given a level you have to return the nodes at the level.
Trapping rain water
Max consecutive ones III - https://leetcode.com/problems/max-consecutive-ones-iii/
maximum profit in job scheduling - https://leetcode.com/problems/maximum-profit-in-job-scheduling/
Given two strings str and pattern, return an array of all the start indices of pattern's anagrams in str.
Input: str = "acbadabcaa", pattern = "aabc" Output: [0,5,6] Explanation:
The substring with start index = 0 is "acba", which is an anagram of "aabc".
The substring with start index = 5 is "abca", which is an anagram of "aabc".
The substring with start index = 6 is "bcaa", which is an anagram of "aabc".
Given an m x n grid of 0 (Water) and 1 (Land), the task is to count the number of islands.
An island is a group of adjacent 1 cells connected horizontally, vertically, or diagonally,
and it is surrounded by water or the grid boundary. The goal is to determine how many distinct islands exist in the grid.
Input: grid[][] =
[[1, 1, 0, 0, 0],
[0, 1, 0, 0, 1],
[1, 0, 0, 1, 1],
[0, 0, 0, 0, 0],
[1, 0, 1, 1, 0]]
Number of Islands = 4
There are N poles of various heights, and you have a machine whose saw blade can be set at a specific height "h"
and it cuts all poles till that height, such that all of them have height "h" after the cut.
(Poles with height less than "h" remain uncut). You take away the cut portions of all poles with you.
Your task is to take at least M length of poles with you in total after the cut.
What is the maximum height 'h' where you can set your blade to achieve this.
N = 4
M = 7
arr = [20, 15, 10, 17]