🔥 Amazon SDE Interview Questions (Real Experiences + LeetCode Links)
- Posted
- 4 Sept 2025
Summary
I've compiled a comprehensive list of Amazon SDE interview questions gathered from various real candidate experiences on platforms like Reddit and LeetCode Discuss. This provides a clear overview of the types of coding, design, and behavioral problems typically encountered.
How it went
After meticulously reviewing numerous Amazon Software Development Engineer interview experiences, I've identified recurring patterns and specific problems that candidates face. These insights span from new-grad loops to SDE1 roles across different global locations like the US and India. The coding rounds consistently feature problems similar to those found on LeetCode, covering various data structures and algorithms.
I've noted instances of problems requiring dynamic programming with bitmasking, graph traversal, tree manipulations, and string processing. Behavioral questions, often framed around Amazon's Leadership Principles, are also a standard part of the process, sometimes integrated with technical discussions. Some rounds specifically test system design and low-level design capabilities. Overall, the process appears to be rigorous, demanding a solid foundation in core computer science concepts and problem-solving.
Questions asked (49)
- 01
Majority Element
Data Structures & Algorithms
Find the majority element in an array. The majority element is the element that appears more than ⌊n / 2⌋ times.
- 02
Lowest Common Ancestor of N-ary Tree
Data Structures & Algorithms
Find the lowest common ancestor of two nodes in an N-ary tree.
- 03
String Compression
Data Structures & Algorithms
Compress a string such that consecutive repeating characters are replaced with the character and count, e.g., 'aaabbbccc' -> 'a3b3c3'.
- 04
Two Sum
Data Structures & Algorithms
Given an array of integers
numsand an integertarget, return indices of the two numbers such that they add up totarget. - 05
Median of Two Sorted Arrays
Data Structures & Algorithms
Given two sorted arrays
nums1andnums2of sizemandnrespectively, return the median of the two sorted arrays. - 06
Longest Palindromic Substring
Data Structures & Algorithms
Given a string
s, return the longest palindromic substring ins. - 07
String to Integer (atoi)
Data Structures & Algorithms
Implement the
atoifunction, which converts a string to an integer, handling various edge cases like whitespace, sign, and overflow. - 08
Integer to Roman
Data Structures & Algorithms
Convert an integer to its Roman numeral representation.
- 09
Roman to Integer
Data Structures & Algorithms
Convert a Roman numeral string to its integer representation.
- 10
Valid Parentheses
Data Structures & Algorithms
Given a string
scontaining just the characters '(', ')', '{', '}', '[', ']', determine if the input string is valid. - 11
Merge K Sorted Lists
Data Structures & Algorithms
Merge
ksorted linked lists into one sorted linked list. - 12
Valid Sudoku
Data Structures & Algorithms
Determine if a 9x9 Sudoku board is valid according to Sudoku rules (each row, column, and 3x3 sub-grid must contain digits 1-9 without repetition).
- 13
Combination Sum
Data Structures & Algorithms
Given a set of candidate numbers (
candidates) and a target number (target), find all unique combinations incandidateswhere the candidate numbers sum totarget. The same repeated number may be chosen fromcandidatesan unlimited number of times. - 14
Permutations
Data Structures & Algorithms
Given an array
numsof distinct integers, return all the possible permutations. You can return the answer in any order. - 15
Merge Intervals
Data Structures & Algorithms
Given an array of
intervalswhereintervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. - 16
Rotate List
Data Structures & Algorithms
Given the
headof a linked list, rotate the list to the right bykplaces. - 17
Minimum Path Sum
Data Structures & Algorithms
Given an
m x ngrid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. - 18
Word Search
Data Structures & Algorithms
Given an
m x ngrid of characters and a stringword, returntrueifwordexists in the grid (formed by adjacent cells horizontally or vertically). - 19
Validate Binary Search Tree
Data Structures & Algorithms
Given the
rootof a binary tree, determine if it is a valid binary search tree (BST). - 20
Same Tree
Data Structures & Algorithms
Given the roots of two binary trees
pandq, returntrueif they are the same tree, orfalseotherwise. - 21
Symmetric Tree
Data Structures & Algorithms
Given the
rootof a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). - 22
Binary Tree Level Order Traversal
Data Structures & Algorithms
Given the
rootof a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). - 23
Convert Sorted List to Binary Search Tree
Data Structures & Algorithms
Given the
headof a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree. - 24
Populating Next Right Pointers in Each Node
Data Structures & Algorithms
Populate each next pointer to point to its next right node in a perfect binary tree. If there is no next right node, the next pointer should be set to NULL.
- 25
Best Time to Buy and Sell Stock
Data Structures & Algorithms
You are given an array
priceswhereprices[i]is the price of a given stock on thei-th day. Find the maximum profit you can achieve by buying on one day and selling on a different day. - 26
Word Ladder
Data Structures & Algorithms
Given two words,
beginWordandendWord, and a dictionarywordList, return the number of words in the shortest transformation sequence frombeginWordtoendWord. - 27
Word Ladder II
Data Structures & Algorithms
Given two words,
beginWordandendWord, and a dictionarywordList, return all shortest transformation sequences frombeginWordtoendWord. - 28
LRU Cache Design
Data Structures & Algorithms
Design and implement a Least Recently Used (LRU) cache with
getandputoperations, both running in O(1) average time complexity. - 29
Min Stack Design
Data Structures & Algorithms
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
- 30
Number of Islands
Data Structures & Algorithms
Given an
m x n2D binary grid which represents a map of '1's (land) and '0's (water), return the number of islands. - 31
Course Schedule
Data Structures & Algorithms
Given the total number of courses and a list of prerequisite pairs, return true if you can finish all courses.
- 32
Course Schedule II
Data Structures & Algorithms
Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should take to finish all courses.
- 33
Design Add and Search Word Data Structure
Data Structures & Algorithms
Design a data structure that supports adding new words and finding if a string matches any previously added word. The search function can use '.' for any single character.
- 34
Word Search II
Data Structures & Algorithms
Given an
m x nboardof characters and a list of stringswords, return all words on the board that can be found by following sequences of letters. - 35
Integer to English Words
Data Structures & Algorithms
Convert a non-negative integer to its English words representation.
- 36
Game of Life
Data Structures & Algorithms
Implement Conway's Game of Life. Given a 2D
boardrepresenting the current state of a grid with cells that are either live (1) or dead (0), update the board to the next state. - 37
Find Median from Data Stream
Data Structures & Algorithms
The median is the middle value in an ordered integer list. Design a data structure that supports adding integers and finding the median of the current numbers.
- 38
Longest Increasing Subsequence
Data Structures & Algorithms
Given an integer array
nums, return the length of the longest strictly increasing subsequence. - 39
Design Tic-Tac-Toe
Data Structures & Algorithms
Design a Tic-Tac-Toe game that can be played on an
n x ngrid. Implement functions to make a move and check for a winner. - 40
Pacific Atlantic Water Flow
Data Structures & Algorithms
Given an
m x nmatrix of integers representing the height of each unit cell in a continent, find a list of grid coordinates where water can flow to both the Pacific and Atlantic oceans. - 41
Minesweeper
Data Structures & Algorithms
Given a 2D
boardrepresenting a Minesweeper game, update it to its next state given the click coordinates. - 42
Diameter of Binary Tree
Data Structures & Algorithms
Given the
rootof a binary tree, return the length of the diameter of the tree. The diameter is the length of the longest path between any two nodes in a tree. - 43
Reorganize String
Data Structures & Algorithms
Given a string
s, rearrange the characters ofssuch that any two adjacent characters are not the same. If it is not possible, return an empty string. - 44
Count Nodes in Complete Binary Tree
Data Structures & Algorithms
Given the
rootof a complete binary tree, return the number of nodes in the tree. - 45
Sort Characters by Frequency
Data Structures & Algorithms
Given a string
s, sort it in decreasing order based on the frequency of the characters. - 46
Aggressive Cows
Data Structures & Algorithms
Given an array representing
nstalls andkaggressive cows, assignkcows tokstalls such that the minimum distance between any two of them is maximized. - 47
Directed Graph Edge Score
Data Structures & Algorithms
Given a directed graph, find the node that has the highest edge score. The edge score of a node is the sum of the values of all nodes that point to it.
- 48
Count Anagrammatic Substrings
Data Structures & Algorithms
Given two strings
s1ands2, count the total number of substrings ins2that are anagrams ofs1. - 49
Shortest Path Visiting All Nodes (LC 847)
Data Structures & Algorithms
Open the problemYou have an undirected, connected graph of
nnodes labeled from0ton - 1. You are given an arraygraphwheregraph[i]is a list of all the nodes connected with nodeiby an edge. Return the length of the shortest path that visits every node in the graph. You may start and stop at any node, and you may revisit nodes multiple times. The problem is a variant of TSP solvable with DP + bitmasking.
How they prepared
Based on these collective experiences, my preparation would involve a strong focus on LeetCode problems, particularly those frequently reported by Amazon candidates. I would categorize and practice problems across common themes like arrays, strings, trees, graphs, dynamic programming, and data structure design. Additionally, I would dedicate time to understanding and articulating solutions to system design questions and meticulously prepare examples for behavioral questions aligned with Amazon's Leadership Principles. Reviewing specific LeetCode problem patterns, especially those involving optimized approaches like DP with bitmasking, would be crucial.