Recent interview Questions for Amazon
Prepare better for facebook
if you want to save time even more SUBSCRIBE to get questions from most frequently asked to least
- Project Employees III
- Maximum Path Quality of a Graph
- Largest Rectangle in Histogram
- Add Two Integers
- Max Area of Island
- Trim a Binary Search Tree
- Sort List
- Largest BST Subtree
- Read N Characters Given read4 II - Call Multiple Times
- Lowest Common Ancestor of a Binary Search Tree
- Monotonic Array
- Valid Mountain Array
- Calculate Amount Paid in Taxes
- Valid Palindrome
- Contains Duplicate II
- Generate Random Point in a Circle
- Valid Parenthesis String
- Single-Threaded CPU
- Remove Duplicates from Sorted Array II
- Maximum Number of Ways to Partition an Array
- Fibonacci Number
- Counter
- Find a Corresponding Node of a Binary Tree in a Clone of That Tree
- Unique Number of Occurrences
- Find the Index of the First Occurrence in a String
- Shuffle an Array
- Meeting Rooms
- Find K-th Smallest Pair Distance
- Consecutive Characters
- Friend Requests I: Overall Acceptance Rate
- Rotate List
- Kth Largest Element in an Array
- Palindrome Number
- Single Number
- Repeated Substring Pattern
- Crawler Log Folder
- Binary Tree Cameras
- Bulls and Cows
- Defanging an IP Address
- Delete Node in a BST
- Steps to Make Array Non-decreasing
- Contains Duplicate
- Restore IP Addresses
- Total Hamming Distance
- Divide Two Integers
- Letter Combinations of a Phone Number
- Longest Repeating Character Replacement
- Rank Transform of an Array
- Add One Row to Tree
- Nearest Exit from Entrance in Maze
- Nested List Weight Sum
- Flatten Nested List Iterator
- Split Array Largest Sum
- Find All Anagrams in a String
- Trapping Rain Water II
- Convert Sorted List to Binary Search Tree
- Reorder List
- Insert into a Sorted Circular Linked List
- Stickers to Spell Word
- Verifying an Alien Dictionary
- Partition Labels
- Swapping Nodes in a Linked List
- Previous Permutation With One Swap
- Primary Department for Each Employee
- Number of Islands
- Plus One
- Maximum Compatibility Score Sum
- Number of Distinct Islands II
- Maximum Depth of Binary Tree
- Shortest Word Distance
- Consecutive Numbers
- Accounts Merge
- Jump Game III
- Angle Between Hands of a Clock
- Reorganize String
- Find the Difference
- The Number of Weak Characters in the Game
- Design HashMap
- Minimum Window Substring
- Bulb Switcher
- Friends Of Appropriate Ages
- Number of 1 Bits
- Shortest Way to Form String
- Valid Triangle Number
- Minimum Swaps To Make Sequences Increasing
- Text Justification
- Reverse Bits
- Max Stack
- Department Highest Salary
- Kth Ancestor of a Tree Node
- Count and Say
- Diameter of N-Ary Tree
- Car Pooling
- Subtract the Product and Sum of Digits of an Integer
- Build Array from Permutation
- K-th Symbol in Grammar
- Subarray Product Less Than K
- Sudoku Solver
- Single Element in a Sorted Array
- Insert Delete GetRandom O(1) - Duplicates allowed
- Minimum Depth of Binary Tree
- Binary Tree Inorder Traversal
- Two City Scheduling
- All Nodes Distance K in Binary Tree
- Buildings With an Ocean View
- Wildcard Matching
- Exclusive Time of Functions
- Similar String Groups
- Minimum Add to Make Parentheses Valid
- Maximum Average Subtree
- Search in Rotated Sorted Array
- Swap Nodes in Pairs
- Kth Largest Element in a Stream
- Word Search II
- Tree Diameter
- Find Leaves of Binary Tree
- Product of Array Except Self
- Lowest Common Ancestor of Deepest Leaves
- Check If Two String Arrays are Equivalent
- Check Knight Tour Configuration
- Find First and Last Position of Element in Sorted Array
- Maximum Swap
- Longest Substring with At Most Two Distinct Characters
- Insert Delete GetRandom O(1)
- Reconstruct Itinerary
- Page Recommendations II
- Best Time to Buy and Sell Stock with Transaction Fee
- Next Greater Element III
- Course Schedule
- Replace Elements with Greatest Element on Right Side
- Binary Search Tree Iterator II
- Trapping Rain Water
- Roman to Integer
- Valid Number
- Alien Dictionary
- Simplify Path
- Two Sum Less Than K
- Sum Root to Leaf Numbers
- Merge Two Binary Trees
- Expression Add Operators
- Valid Perfect Square
- Reported Posts
- Minimum Average Difference
- Increasing Triplet Subsequence
- Subsets
- Sort Array By Parity
- Task Scheduler II
- Find All Numbers Disappeared in an Array
- Serialize and Deserialize Binary Tree
- Course Schedule II
- Same Tree
- Spiral Matrix II
- Longest Substring Without Repeating Characters
- Maximum Number of Darts Inside of a Circular Dartboard
- Remove Covered Intervals
- Remove All Adjacent Duplicates In String
- Cousins in Binary Tree
- Continuous Subarray Sum
- Missing Number
- Minimum Area Rectangle
- Smallest String With A Given Numeric Value
- Count Nodes Equal to Average of Subtree
- Reported Posts II
- Move Zeroes
- Integer to English Words
- Find K Closest Elements
- Encode and Decode Strings
- Rectangle Overlap
- Balanced Binary Tree
- Sum of Square Numbers
- Maximum Gap
- Strong Friendship
- Best Time to Buy and Sell Stock II
- Buddy Strings
- Jump Game II
- Find Median from Data Stream
- Reverse Linked List
- Apply Discount Every n Orders
- Group Shifted Strings
- Merge Sorted Array
- Process Restricted Friend Requests
- Top K Frequent Elements
- Lowest Common Ancestor of a Binary Tree III
- Length of Last Word
- Find the Celebrity
- Remove Duplicates from Sorted List
- Maximum Product Subarray
- Combinations
- Two Sum IV - Input is a BST
- Intersection of Two Linked Lists
- Check Array Formation Through Concatenation
- Find the Duplicate Number
- Number of Squareful Arrays
- Replace Words
- Groups of Special-Equivalent Strings
- LFU Cache
- Word Ladder II
- Number of Distinct Islands
- H-Index
- Integer to Roman
- Moving Average from Data Stream
- Longest Increasing Subsequence
- Binary Tree Zigzag Level Order Traversal
- Find Largest Value in Each Tree Row
- Number of Matching Subsequences
- Number of Pairs of Strings With Concatenation Equal to Target
- Range Sum Query 2D - Immutable
- Palindrome Permutation
- Lowest Common Ancestor of a Binary Tree II
- Reverse Linked List II
- Count Nodes Equal to Sum of Descendants
- First Missing Positive
- Implement Trie (Prefix Tree)
- Maximal Rectangle
- Delete and Earn
- Ransom Note
- Next Greater Element II
- Sum of All Odd Length Subarrays
- Finding Pairs With a Certain Sum
- Validate Binary Search Tree
- Minimum Cost to Reach Destination in Time
- Merge Intervals
- Web Crawler Multithreaded
- Median of Two Sorted Arrays
- Goat Latin
- Print Immutable Linked List in Reverse
- Number of Subsequences That Satisfy the Given Sum Condition
- Flatten Binary Tree to Linked List
- Triangle Judgement
- Minimum Cost For Tickets
- Unique Binary Search Trees II
- Lowest Common Ancestor of a Binary Tree
- Maximum Difference Between Node and Ancestor
- Maximum Level Sum of a Binary Tree
- Closest Binary Search Tree Value
- Recyclable and Low Fat Products
- Kth Smallest Element in a Sorted Matrix
- Daily Temperatures
- Queries Quality and Percentage
- Merge Two Sorted Lists
- Range Sum of BST
- Combination Sum IV
- Partition List
- Battleships in a Board
- Apples & Oranges
- Number of Valid Move Combinations On Chessboard
- Walls and Gates
- Report Contiguous Dates
- Can Place Flowers
- Big Countries
- Step-By-Step Directions From a Binary Tree Node to Another
- Clone Graph
- Sorting the Sentence
- Shortest Bridge
- Evaluate Division
- Minesweeper
- Page Recommendations
- Next Permutation
- Binary Search Tree to Greater Sum Tree
- Longest Substring with At Most K Distinct Characters
- Squares of a Sorted Array
- Image Smoother
- Project Employees II
- Min Cost to Connect All Points
- Sliding Window Median
- Remove Outermost Parentheses
- Missing Ranges
- Make Two Arrays Equal by Reversing Subarrays
- Sum of Left Leaves
- Top K Frequent Words
- Best Time to Buy and Sell Stock
- Shortest Path in a Hidden Grid
- Palindromic Substrings
- Minimum Number of Arrows to Burst Balloons
- Max Consecutive Ones III
- Reverse Nodes in k-Group
- Binary Search
- Set Matrix Zeroes
- Binary Tree Level Order Traversal
- Dota2 Senate
- Two Sum II - Input Array Is Sorted
- Scramble String
- Find Minimum in Rotated Sorted Array
- All Possible Full Binary Trees
- Contiguous Array
- Binary Search Tree Iterator
- Zigzag Conversion
- Decode Ways II
- Minimum Path Cost in a Hidden Grid
- LRU Cache
- Maximum Frequency Stack
- Koko Eating Bananas
- Missing Element in Sorted Array
- Path Sum II
- Regular Expression Matching
- Non-overlapping Intervals
- Binary Tree Paths
- Queue Reconstruction by Height
- Remove Duplicate Letters
- Maximal Square
- Inorder Successor in BST
- Find the Kth Smallest Sum of a Matrix With Sorted Rows
- Sparse Matrix Multiplication
- Reverse Integer
- Customers Who Bought Products A and B but Not C
- Add to Array-Form of Integer
- Sort Characters By Frequency
- Remove Element
- H-Index II
- Random Pick with Weight
- Valid Word Abbreviation
- Design Add and Search Words Data Structure
- Find Target Indices After Sorting Array
- Valid Palindrome III
- Moving Stones Until Consecutive
- Basic Calculator III
- 4Sum II
- Strobogrammatic Number
- Longest Increasing Path in a Matrix
- Maximum Size Subarray Sum Equals k
- Diameter of Binary Tree
- The k-th Lexicographical String of All Happy Strings of Length n
- Path Sum III
- Coin Change
- Binary Tree Pruning
- Create Hello World Function
- Excel Sheet Column Number
- Shortest Path in Binary Matrix
- Longest Palindromic Subsequence
- Number of Connected Components in an Undirected Graph
- Minimum Insertions to Balance a Parentheses String
- Word Break II
- Intersection of Three Sorted Arrays
- Sum of Unique Elements
- The Number of Beautiful Subsets
- Peeking Iterator
- Diagonal Traverse II
- Words Within Two Edits of Dictionary
- N-Queens
- Knight Dialer
- Rotate Image
- Running Sum of 1d Array
- Count Number of Teams
- Longest Continuous Increasing Subsequence
- Minimum Height Trees
- Binary Tree Right Side View
- Count Pairs Whose Sum is Less than Target
- Kth Smallest Element in a BST
- Reverse Pairs
- Employee Free Time
- Single Number III
- Number of Visible People in a Queue
- Implement Magic Dictionary
- Intersection of Two Arrays
- User Activity for the Past 30 Days I
- Strobogrammatic Number II
- Flatten a Multilevel Doubly Linked List
- Shortest Subarray with Sum at Least K
- Shortest Distance from All Buildings
- 3Sum
- The Maze
- Path Sum
- Word Pattern
- Maximize the Confusion of an Exam
- Best Meeting Point
- Vertical Order Traversal of a Binary Tree
- Dot Product of Two Sparse Vectors
- Remove Duplicates from Sorted Array
- Construct Binary Search Tree from Preorder Traversal
- Maximum Subarray Sum with One Deletion
- Search in Rotated Sorted Array II
- Excel Sheet Column Title
- Reverse Words in a String
- Binary Tree Vertical Order Traversal
- Meeting Rooms II
- 3Sum Smaller
- Island Perimeter
- Remove Duplicates from Sorted List II
- Minimum Operations to Make a Uni-Value Grid
- Largest Plus Sign
- Read N Characters Given Read4
- Fraction to Recurring Decimal
- Maximum Subarray
- Two Sum
- Task Scheduler
- Partition Equal Subset Sum
- First Unique Number
- Perfect Squares
- Inorder Successor in BST II
- Longest Arithmetic Subsequence of Given Difference
- Check if One String Swap Can Make Strings Equal
- Get Highest Answer Rate Question
- Number of Enclaves
- Find in Mountain Array
- Kth Missing Positive Number
- Palindrome Partitioning
- Add Bold Tag in String
- Search Suggestions System
- Min Stack
- The Skyline Problem
- Word Ladder
- Faulty Sensor
- Partition Array for Maximum Sum
- Pow(x, n)
- Binary Tree Maximum Path Sum
- Design Search Autocomplete System
- Remove All Adjacent Duplicates in String II
- Minimum Remove to Make Valid Parentheses
- Hamming Distance
- Find the Winner of the Circular Game
- Convert Binary Search Tree to Sorted Doubly Linked List
- Largest Number
- Maximum Width of Binary Tree
- Populating Next Right Pointers in Each Node II
- Flood Fill
- Reverse String
- Custom Sort String
- Diagonal Traverse
- Longest Common Prefix
- Separate the Digits in an Array
- Sum of k-Mirror Numbers
- Sqrt(x)
- Peak Index in a Mountain Array
- Target Sum
- Remove K Digits
- Prefix and Suffix Search
- Count Hills and Valleys in an Array
- Candy Crush
- Critical Connections in a Network
- Symmetric Tree
- Middle of the Linked List
- Intersection of Two Arrays II
- Letter Case Permutation
- Ads Performance
- Add Strings
- Interval List Intersections
- Increasing Order Search Tree
- First Bad Version
- Average of Levels in Binary Tree
- K Closest Points to Origin
- Maximum Number of Tasks You Can Assign
- Remove Nth Node From End of List
- Multiply Strings
- Find Distance in a Binary Tree
- Check if an Original String Exists Given Two Encoded Strings
- Basic Calculator
- Maximum Binary Tree II
- Average Time of Process per Machine
- Unique Paths II
- Number of Ways to Arrive at Destination
- Majority Element II
- Remove Invalid Parentheses
- Invert Binary Tree
- Toeplitz Matrix
- Valid Parentheses
- Jump Game V
- Check if the Sentence Is Pangram
- Valid Anagram
- Palindrome Permutation II
- First Unique Character in a String
- Delete Nodes And Return Forest
- Group Anagrams
- Subarray Sum Equals K
- Number of Good Pairs
- Find K Pairs with Smallest Sums
- Find All Duplicates in an Array
- Rectangle Area
- Ugly Number
- Number of Longest Increasing Subsequence
- Generate Parentheses
- Longest Palindromic Substring
- Spiral Matrix
- Construct Binary Tree from String
- Unique Paths
- Next Greater Element I
- Leftmost Column with at Least a One
- The Score of Students Solving Math Expression
- House Robber III
- Guess Number Higher or Lower
- Permutation in String
- Evaluate Reverse Polish Notation
- Number of Substrings Containing All Three Characters
- Web Crawler
- Candy
- Swim in Rising Water
- Palindrome Pairs
- Sum of Two Integers
- 3Sum Closest
- Construct String from Binary Tree
- Find the Middle Index in Array
- Integer Break
- Range Sum Query - Immutable
- Convert BST to Greater Tree
- Capacity To Ship Packages Within D Days
- Path With Maximum Minimum Value
- Longest Univalue Path
- Score of Parentheses
- Decode Ways
- Add Binary
- Longest Subsequence Repeated k Times
- Binary Tree Postorder Traversal
- Merge k Sorted Lists
- Making A Large Island
- Container With Most Water
- Graph Valid Tree
- Pascal's Triangle
- Jump Game
- Combination Sum
- Number of Comments per Post
- Balance a Binary Search Tree
- Palindrome Linked List
- Finding the Topic of Each Post
- Partition to K Equal Sum Subsets
- Minimum Number of Swaps to Make the String Balanced
- Asteroid Collision
- Paint House II
- Fizz Buzz
- Encode and Decode TinyURL
- Rotated Digits
- Maximum Average Subarray I
- Cutting Ribbons
- Random Pick Index
- All Paths From Source to Target
- Different Ways to Add Parentheses
- Valid Sudoku
- Number Of Corner Rectangles
- Unique Paths III
- House Robber
- Redundant Connection
- Longest Valid Parentheses
- Check Completeness of a Binary Tree
- Valid Palindrome II
- Subsets II
- One Edit Distance
- Populating Next Right Pointers in Each Node
- Sort Colors
- 01 Matrix
- Sliding Window Maximum
- K Radius Subarray Averages
- Shortest Path Visiting All Nodes
- Permutations
- Word Search
- Design A Leaderboard
- Count Items Matching a Rule
- Boundary of Binary Tree
- The kth Factor of n
- Minimum Absolute Difference in BST
- Odd Even Linked List
- Search a 2D Matrix II
- Number of Calls Between Two Persons
- Max Sum of a Pair With Equal Sum of Digits
- Validate Binary Tree Nodes
- Remove Linked List Elements
- Project Employees I
- Active Users
- Open the Lock
- Construct the Lexicographically Largest Valid Sequence
- Find Winner on a Tic Tac Toe Game
- Climbing Stairs
- Happy Number
- Combination Sum II
- Gas Station
- Sort an Array
- Maximum Nesting Depth of the Parentheses
- Word Break
- Search a 2D Matrix
- Reverse Words in a String III
- Brick Wall
- Subtree of Another Tree
- Find Unique Binary String
- Edit Distance
- Sum of Distances in Tree
- Subarray Sums Divisible by K
- Online Stock Span
- Decode String
- Shortest Path in a Grid with Obstacles Elimination
- Design Tic-Tac-Toe
- Complete Binary Tree Inserter
- Remove One Element to Make the Array Strictly Increasing
- Product of Two Run-Length Encoded Arrays
- 4Sum
- Search Insert Position
- Find Mode in Binary Search Tree
- Find All People With Secret
- Is Graph Bipartite?
- All Elements in Two Binary Search Trees
- Maximum Sum of 3 Non-Overlapping Subarrays
- Binary Tree Longest Consecutive Sequence
- Design Circular Queue
- Delete Operation for Two Strings
- Find Pivot Index
- Robot Room Cleaner
- Rotate Array
- Minimum Time to Collect All Apples in a Tree
- Cheapest Flights Within K Stops
- Coin Change II
- Find Peak Element
- Basic Calculator II
- Minimum Size Subarray Sum
- Minimum Knight Moves
- Moving Stones Until Consecutive II
- String to Integer (atoi)
- Majority Element
- String Compression
- Couples Holding Hands
- Longest Consecutive Sequence
- Design Skiplist
- Detect Cycles in 2D Grid
- Insert Interval
- Add Two Numbers
- Smallest Subtree with all the Deepest Nodes
- User Activity for the Past 30 Days II
- Copy List with Random Pointer
- Friend Requests II: Who Has the Most Friends
- Lexicographical Numbers
- Employees Earning More Than Their Managers