Amazon Coding Interview Questions

Leadership principles plus OA-style arrays, trees, and greedy problems.

#Title
1Two Sum
2Add Two Numbers
3Longest Substring Without Repeating Characters
4Median of Two Sorted Arrays
5Longest Palindromic Substring
8String to Integer (atoi)
11Container With Most Water
153 Sum
17Letter Combinations of a Phone Number
19Remove Nth Node From End of List
20Valid Parentheses
21Merge Two Sorted Lists
22Generate Parentheses
23Merge k Sorted Lists
33Search in Rotated Sorted Array
34Find First and Last Position of Element in Sorted Array
36Valid Sudoku
37Sudoku Solver
39Combination Sum
40Combination Sum II
42Trapping Rain Water
45Jump Game II
46Permutations
48Rotate Image
49Group Anagrams
51N-Queens
53Maximum Subarray
55Jump Game
56Merge Intervals
62Unique Paths
63Unique Paths II
67Add Binary
69Sqrt(x)
70Climbing Stairs
71Simplify Path
72Edit Distance
73Set Matrix Zeroes
74Search a 2D Matrix
75Sort Colors
76Minimum Window Substring
77Combinations
78Subsets
79Word Search
82Remove Duplicates from Sorted List II
84Largest Rectangle in Histogram
85Maximal Rectangle
86Partition List
89Gray Code
90Subsets II
91Decode Ways
92Reverse Linked List II
93Restore IP Addresses
94Binary Tree Inorder Traversal
95Unique Binary Search Trees II
96Unique Binary Search Trees
97Interleaving String
98Validate Binary Search Tree
99Recover Binary Search Tree
100Same Tree
101Symmetric Tree
102Binary Tree Level Order Traversal
103Binary Tree Zigzag Level Order Traversal
104Maximum Depth of Binary Tree
105Construct Binary Tree from Preorder and Inorder Traversal
106Construct Binary Tree from Inorder and Postorder Traversal
107Binary Tree Level Order Traversal II
108Convert Sorted Array to Binary Search Tree
109Convert Sorted List to Binary Search Tree
110Balanced Binary Tree
111Minimum Depth of Binary Tree
112Path Sum
113Path Sum II
114Flatten Binary Tree to Linked List
115Distinct Subsequences
116Populating Next Right Pointers in Each Node
117Populating Next Right Pointers in Each Node II
118Pascal's Triangle
119Pascal's Triangle II
120Triangle
121Best Time to Buy and Sell Stock
122Best Time to Buy and Sell Stock II
123Best Time to Buy and Sell Stock III
124Binary Tree Maximum Path Sum
125Valid Palindrome
126Word Ladder II
127Word Ladder
128Longest Consecutive Sequence
129Sum Root to Leaf Numbers
130Surrounded Regions
131Palindrome Partitioning
132Palindrome Partitioning II
133Clone Graph
134Gas Station
135Candy
136Single Number
137Single Number II
138Copy List with Random Pointer
139Word Break
140Word Break II
141Linked List Cycle
142Linked List Cycle II
143Reorder List
144Binary Tree Preorder Traversal
145Binary Tree Postorder Traversal
146LRU Cache
147Insertion Sort List
148Sort List
150Evaluate Reverse Polish Notation
151Reverse Words in a String
152Maximum Product Subarray
153Find Minimum in Rotated Sorted Array
155Min Stack
160Intersection of Two Linked Lists
162Find Peak Element
164Maximum Gap
165Compare Version Numbers
166Fraction to Recurring Decimal
167Two Sum II - Input array is sorted
169Majority Element
179Largest Number
188Best Time to Buy and Sell Stock IV
189Rotate Array
191Number of 1 Bits
198House Robber
199Binary Tree Right Side View
200Number of Islands
201Bitwise AND of Numbers Range
202Happy Number
203Remove Linked List Elements
204Count Primes
205Isomorphic Strings
206Reverse Linked List
207Course Schedule
208Implement Trie (Prefix Tree)
209Minimum Size Subarray Sum
210Course Schedule II
215Kth Largest Element in an Array
216Combination Sum III
217Contains Duplicate
219Contains Duplicate II
220Contains Duplicate III
221Maximal Square
222Count Complete Tree Nodes
223Rectangle Area
227Basic Calculator II
229Majority Element II
230Kth Smallest Element in a BST
231Power of Two
232Implement Queue using Stacks
233Number of Digit One
234Palindrome Linked List
235Lowest Common Ancestor of a Binary Search Tree
236Lowest Common Ancestor of a Binary Tree
237Delete Node in a Linked List
238Product of Array Except Self
239Sliding Window Maximum
240Search a 2D Matrix II
241Different Ways to Add Parentheses
242Valid Anagram
257Binary Tree Paths
260Single Number III
264Ugly Number II
268Missing Number
287Find the Duplicate Number
299Bulls and Cows
300Longest Increasing Subsequence
304Range Sum Query 2D - Immutable
322Coin Change
328Odd Even Linked List
329Longest Increasing Path in a Matrix
334Increasing Triplet Subsequence
337House Robber III
338Counting Bits
340Longest Substring with At Most K Distinct Characters
343Integer Break
344Reverse String
346Moving Average from Data Stream
347Top K Frequent Elements
349Intersection of Two Arrays
350Intersection of Two Arrays II
353Design Snake Game
355Design Twitter
373Find K Pairs with Smallest Sums
378Kth Smallest Element in a Sorted Matrix
380Insert Delete GetRandom O(1)
383Ransom Note
384Shuffle an Array
387First Unique Character in a String
394Decode String
404Sum of Left Leaves
417Pacific Atlantic Water Flow
424Longest Repeating Character Replacement
437Path Sum III
438Find All Anagrams in a String
442Find All Duplicates in an Array
445Add Two Numbers II
449Serialize and Deserialize BST
450Delete Node in a BST
451Sort Characters By Frequency
456132 Pattern
459Repeated Substring Pattern
529Minesweeper
535Encode and Decode TinyURL
538Convert BST to Greater Tree
543Diameter of Binary Tree
547Friend Circles
560Subarray Sum Equals K
561Array Partition I
606Construct String from Binary Tree
609Find Duplicate File in System
621Task Scheduler
645Set Mismatch
646Maximum Length of Pair Chain
647Palindromic Substrings
653Two Sum IV - Input is a BST
658Find K Closest Elements
661Image Smoother
662Maximum Width of Binary Tree
663Equal Tree Partition
670Maximum Swap
673Number of Longest Increasing Subsequence
682Baseball Game
688Knight Probability in Chessboard
690Employee Importance
746Min Cost Climbing Stairs
762Prime Number of Set Bits in Binary Representation
763Partition Labels
787Cheapest Flights Within K Stops
814Binary Tree Pruning
815Bus Routes
819Most Common Word
821Shortest Distance to a Character
853Car Fleet
856Score of Parentheses
860Lemonade Change
862Shortest Subarray with Sum at Least K
863All Nodes Distance K in Binary Tree
875Koko Eating Bananas
890Find and Replace Pattern
901Online Stock Span
905Sort Array By Parity
907Sum of Subarray Minimums
909Snakes and Ladders
918Maximum Sum Circular Subarray
9233Sum With Multiplicity
929Unique Email Addresses
930Binary Subarrays With Sum
931Minimum Falling Path Sum
934Shortest Bridge
939Minimum Area Rectangle
953Verifying an Alien Dictionary
957Prison Cells After N Days
958Check Completeness of a Binary Tree
961N-Repeated Element in Size 2N Array
983Minimum Cost For Tickets
1160Find Words That Can Be Formed by Characters