117 problems · 20 Easy, 76 Medium, 21 Hard · Ranked #1 of 459
Difficulty breakdown
20 Easy
17% · avg 23%
76 Medium
65% · avg 59%
21 Hard
18% · avg 18%
Top topics
array
46.2%
string
30.8%
dynamic-programming
17.9%
two-pointers
16.2%
math
14.5%
hash-table
13.7%
Interview profile
Based on 117 reported problems, Amazon interviews are in line with industry averages - 18% Hard vs 18% overall. The majority (65%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.
Compared to the industry average, Amazon puts unusual emphasis on binary-search-tree (4.3% of problems, 3.8x the industry average), backtracking (13.7% of problems, 2.6x the industry average), recursion (6.8% of problems, 1.5x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (46.2%), string (30.8%), dynamic-programming (17.9%), two-pointers (16.2%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 117 problems
Problem
Difficulty
Frequency
Topics
Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirec...
Number of Connected Components in an Undirected Graph
You have a graph of n nodes. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi in the gr...
Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive c...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...
You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive)....
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the his...
An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the average time it ta...
A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ith triplet. You are also giv...
There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner...
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order...
There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or...
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is inc...
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better...
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number...
You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most sig...
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were ins...
Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right,...
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only...
You are given an absolute path for a Unix-style file system, which always begins with a slash '/'. Your task is to transform this absolute path into its simplif...
Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative or...
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to...
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and interv...
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justifie...
You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-r...
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in...
You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changi...
A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked li...
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirec...
You have a graph of n nodes. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi in the gr...
Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive c...
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length...
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...
You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (inclusive)....
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST.
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the his...
HardLikely
arraystackmonotonic-stack
Find First and Last Position of Element in Sorted Array
An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the average time it ta...
A triplet is an array of three integers. You are given a 2D integer array triplets, where triplets[i] = [ai, bi, ci] describes the ith triplet. You are also giv...
There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner...
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order...
There are n dominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or...
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is inc...
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better...
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum...
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number...
You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most sig...
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were ins...
Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right,...
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only...
You are given an absolute path for a Unix-style file system, which always begins with a slash '/'. Your task is to transform this absolute path into its simplif...
Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The relative or...
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to...
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and interv...
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justifie...
You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-r...
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in...
You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changi...
A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros.
Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked li...
We can scramble a string s to get a string t using the following algorithm:
HardRare
stringdynamic-programming
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Amazon interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your Amazon coding interview
Amazon interviews focus heavily on array, string, dynamic-programming problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. Amazon interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does Amazon ask in interviews?add
Amazon has been reported to ask 117 distinct coding problems. The most common topics are array, string, dynamic-programming. 20 are Easy difficulty, 76 are Medium, and 21 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are Amazon coding interviews?add
Based on 117 reported problems, Amazon interviews are in line with industry averages - 18% Hard vs 18% overall. 65% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a Amazon coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, string, dynamic-programming. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real Amazon coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.