Recent interview Questions for Amazon
Prepare better for microsoft
if you want to save time even more SUBSCRIBE to get questions from most frequently asked to least
- Gas Station
- 3Sum
- Find the Duplicate Number
- Super Washing Machines
- Maximum of Absolute Value Expression
- Max Dot Product of Two Subsequences
- Make the Prefix Sum Non-negative
- Implement Trie (Prefix Tree)
- Amount of Time for Binary Tree to Be Infected
- Construct Binary Tree from Inorder and Postorder Traversal
- Count Univalue Subtrees
- Number of Times Binary String Is Prefix-Aligned
- Product of Array Except Self
- Interleaving String
- Find Two Non-overlapping Sub-arrays Each With Target Sum
- Linked List Cycle II
- Random Pick with Weight
- Replace All ?'s to Avoid Consecutive Repeating Characters
- Count Servers that Communicate
- 3Sum Closest
- Minimum Number of Moves to Make Palindrome
- Subarray Sum Equals K
- Sum of Two Integers
- Stone Game IV
- Sum of Subarray Minimums
- Design Hit Counter
- Heaters
- Battleships in a Board
- Word Break
- Word Search II
- Clone Graph
- Design HashMap
- Counting Bits
- Frequency of the Most Frequent Element
- Smallest String With Swaps
- Day of the Year
- Number of Dice Rolls With Target Sum
- Palindrome Linked List
- Edit Distance
- Shuffle the Array
- Making A Large Island
- Max Pair Sum in an Array
- Shuffle String
- Largest Number
- Remove All Adjacent Duplicates In String
- Add Strings
- Regular Expression Matching
- Maximum Vacation Days
- Analyze User Website Visit Pattern
- Making File Names Unique
- Trim a Binary Search Tree
- Minimum Path Sum
- Cinema Seat Allocation
- Fibonacci Number
- Number of Connected Components in an Undirected Graph
- Can Place Flowers
- Reverse Linked List
- Find Minimum in Rotated Sorted Array II
- Minimum Moves to Equal Array Elements
- Evaluate Division
- Integer Break
- Unique Paths II
- Minimum Incompatibility
- Remove All Adjacent Duplicates in String II
- Letter Case Permutation
- Rearrange String k Distance Apart
- Split Array With Same Average
- Path Sum II
- Backspace String Compare
- Car Pooling
- Shortest Path Visiting All Nodes
- Flip String to Monotone Increasing
- Closest Dessert Cost
- Valid Parenthesis String
- Intersection of Two Linked Lists
- Minimum Knight Moves
- Search Insert Position
- Max Stack
- Water Bottles
- Invert Binary Tree
- Copy List with Random Pointer
- Minimum Window Substring
- Design In-Memory File System
- The Skyline Problem
- Meeting Rooms II
- Count Good Nodes in Binary Tree
- Max Consecutive Ones III
- Remove Duplicates From an Unsorted Linked List
- First Missing Positive
- Basic Calculator III
- Candy
- Minimum Deletions to Make Array Beautiful
- Find Minimum in Rotated Sorted Array
- Smallest Range Covering Elements from K Lists
- Number of Digit One
- Decode Ways
- Add Two Numbers II
- Majority Element
- Partition Array Into Two Arrays to Minimize Sum Difference
- Validate Binary Search Tree
- Valid Number
- Delete Tree Nodes
- Bulb Switcher II
- Minimum Deletions to Make Character Frequencies Unique
- Remove Linked List Elements
- Exclusive Time of Functions
- Predict the Winner
- Task Scheduler
- Permutations II
- Next Greater Element I
- Maximum Length of a Concatenated String with Unique Characters
- Lowest Common Ancestor of a Binary Tree III
- Rotate String
- Subarray Sums Divisible by K
- Create Hello World Function
- Substring with Concatenation of All Words
- Average Height of Buildings in Each Segment
- Distribute Coins in Binary Tree
- Subtree of Another Tree
- Excel Sheet Column Number
- Pow(x, n)
- Clumsy Factorial
- Merge Two Sorted Lists
- Find Median from Data Stream
- Running Sum of 1d Array
- Contiguous Array
- Web Crawler
- Longest Palindromic Subsequence
- Number of Subarrays with Bounded Maximum
- Maximum Value at a Given Index in a Bounded Array
- Capacity To Ship Packages Within D Days
- Coin Change II
- Number of Ways to Split a String
- Binary Tree Zigzag Level Order Traversal
- Number of Good Pairs
- Frog Jump
- Minimum Number of Days to Make m Bouquets
- Valid Square
- The Maze II
- Find All The Lonely Nodes
- Design Search Autocomplete System
- Intersection of Two Arrays II
- Widest Pair of Indices With Equal Range Sum
- Implement Queue using Stacks
- Recyclable and Low Fat Products
- Sum of Digits of String After Convert
- Reverse Integer
- Minimum Amount of Time to Collect Garbage
- Minimize the Maximum Difference of Pairs
- Reverse Words in a String II
- Inorder Successor in BST II
- Is Subsequence
- Alien Dictionary
- Lowest Common Ancestor of Deepest Leaves
- Longest Path With Different Adjacent Characters
- Reverse Pairs
- Generate Parentheses
- Find the Difference
- Plus One
- Integer to English Words
- Kth Smallest Element in a Sorted Matrix
- Pacific Atlantic Water Flow
- Longest Duplicate Substring
- Delete Operation for Two Strings
- 132 Pattern
- Largest Rectangle in Histogram
- Maximum Width of Binary Tree
- Merge Intervals
- Unique Paths
- Word Ladder II
- Recover Binary Search Tree
- Construct Binary Tree from Preorder and Inorder Traversal
- Palindrome Number
- Restore the Array From Adjacent Pairs
- Maximum Score Of Spliced Array
- Design Add and Search Words Data Structure
- Palindromic Substrings
- Longest Common Subsequence
- Shortest Path in Binary Matrix
- Reverse Substrings Between Each Pair of Parentheses
- Flood Fill
- Count Substrings That Differ by One Character
- Previous Permutation With One Swap
- Rotate Image
- Count Primes
- Path Sum III
- Find Distance in a Binary Tree
- Search in Rotated Sorted Array II
- Design A Leaderboard
- Root Equals Sum of Children
- Minimum Add to Make Parentheses Valid
- Possible Bipartition
- Ways to Split Array Into Three Subarrays
- Binary Tree Level Order Traversal
- Median of Two Sorted Arrays
- Minimum Time to Make Rope Colorful
- Combination Sum II
- Largest Palindromic Number
- Parallel Courses
- Find First and Last Position of Element in Sorted Array
- Diameter of Binary Tree
- Valid Palindrome II
- Number of Students Unable to Eat Lunch
- Jump Game II
- Maximum Population Year
- Combinations
- Find Leaves of Binary Tree
- Design Twitter
- Missing Number
- Maximum Length of Repeated Subarray
- Best Meeting Point
- Design Tic-Tac-Toe
- Longest Substring with At Least K Repeating Characters
- Number of Steps to Reduce a Number to Zero
- Find the Celebrity
- Remove Invalid Parentheses
- Insertion Sort List
- Insert into a Sorted Circular Linked List
- Longest Palindromic Substring
- Rotate List
- Lowest Common Ancestor of a Binary Search Tree
- Sort Array By Parity
- Snapshot Array
- Binary Tree Vertical Order Traversal
- Word Break II
- Course Schedule II
- Maximum Employees to Be Invited to a Meeting
- Greatest English Letter in Upper and Lower Case
- Guess the Word
- Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
- Maximum Performance of a Team
- Egg Drop With 2 Eggs and N Floors
- Boundary of Binary Tree
- Widest Vertical Area Between Two Points Containing No Points
- Combination Sum
- Serialize and Deserialize BST
- Top K Frequent Elements
- Time Needed to Inform All Employees
- Middle of the Linked List
- Longest Substring Without Repeating Characters
- Merge Nodes in Between Zeros
- Split a String Into the Max Number of Unique Substrings
- Find And Replace in String
- N-Queens
- Merge Strings Alternately
- Coin Change
- Minimum Operations to Make Array Equal
- Kill Process
- Stream of Characters
- String to Integer (atoi)
- Rotate Array
- 4 Keys Keyboard
- Find if Path Exists in Graph
- The kth Factor of n
- Largest Positive Integer That Exists With Its Negative
- Maximum Product Subarray
- Game of Life
- Find N Unique Integers Sum up to Zero
- Text Justification
- Max Area of Island
- Count and Say
- Valid Perfect Square
- Design HashSet
- Find Smallest Common Element in All Rows
- Convert Sorted Array to Binary Search Tree
- Number of Days Between Two Dates
- Remove Comments
- Maximum Number of Balloons
- Bulls and Cows
- All the Matches of the League
- Remove Duplicates from Sorted List
- Kth Largest Element in a Stream
- Count Negative Numbers in a Sorted Matrix
- Best Time to Buy and Sell Stock
- Partition List
- Divide Two Integers
- Maximum Price to Fill a Bag
- Graph Valid Tree
- Find Winner on a Tic Tac Toe Game
- Car Fleet
- Contains Duplicate II
- Number of Matching Subsequences
- Sort an Array
- The k-th Lexicographical String of All Happy Strings of Length n
- Reverse String II
- Reverse String
- Russian Doll Envelopes
- Longest Mountain in Array
- Course Schedule
- Basic Calculator II
- Water and Jug Problem
- Jump Game
- Number of 1 Bits
- House Robber III
- Surrounded Regions
- Minimum Number of Taps to Open to Water a Garden
- Maximal Rectangle
- Flatten Nested List Iterator
- Buddy Strings
- Nim Game
- Next Greater Element III
- Serialize and Deserialize Binary Tree
- Length of Last Word
- Rectangle Overlap
- Restore IP Addresses
- Minimum Insertions to Balance a Parentheses String
- Roman to Integer
- Longest Substring with At Most Two Distinct Characters
- Pascal's Triangle
- Rotting Oranges
- Insert Interval
- Count of Smaller Numbers After Self
- Add Two Integers
- Wiggle Sort
- Longest Nice Substring
- Two City Scheduling
- Sign of the Product of an Array
- Counting Words With a Given Prefix
- Find Peak Element
- Angle Between Hands of a Clock
- Solve the Equation
- First Unique Character in a String
- Design Skiplist
- Reverse Bits
- Remove Max Number of Edges to Keep Graph Fully Traversable
- Maximal Square
- Longest Univalue Path
- Find Original Array From Doubled Array
- Word Search
- Shortest Path in a Grid with Obstacles Elimination
- Keys and Rooms
- String Compression
- Longest Word in Dictionary
- Delete N Nodes After M Nodes of a Linked List
- Simplify Path
- Minimum Cost to Cut a Stick
- Longest Increasing Path in a Matrix
- Interval List Intersections
- Daily Temperatures
- Multiply Strings
- Remove Outermost Parentheses
- Kth Smallest Element in a BST
- Min Cost to Connect All Points
- Delete the Middle Node of a Linked List
- Maximum Level Sum of a Binary Tree
- Maximum Subarray
- Max Chunks To Make Sorted II
- Number of Atoms
- Intersection of Two Arrays
- Missing Ranges
- Sqrt(x)
- Minimum Insertion Steps to Make a String Palindrome
- Design Linked List
- The Number of Full Rounds You Have Played
- Max Consecutive Ones
- Path With Minimum Effort
- Snakes and Ladders
- Remove Duplicates from Sorted Array
- Reorder List
- Evaluate Reverse Polish Notation
- Longest Happy String
- Valid Parentheses
- Happy Number
- Combination Sum III
- Nth Digit
- Matchsticks to Square
- Validate IP Address
- Equal Sum Arrays With Minimum Number of Operations
- Sort Colors
- Cousins in Binary Tree
- Bulb Switcher
- Maximum Profit in Job Scheduling
- Kth Largest Element in an Array
- Remove Nth Node From End of List
- Longest Increasing Subsequence
- Convert Binary Search Tree to Sorted Doubly Linked List
- Divide Array Into Equal Pairs
- Symmetric Tree
- Next Greater Element II
- Search Suggestions System
- Image Smoother
- Fizz Buzz
- 01 Matrix
- Diagonal Traverse
- Maximum Binary Tree
- Is Graph Bipartite?
- Asteroid Collision
- Number of Steps to Reduce a Number in Binary Representation to One
- Unique Binary Search Trees
- Number of Unique Flavors After Sharing K Candies
- Minimum Time Difference
- Add Two Numbers
- Longest Valid Parentheses
- Meeting Rooms
- My Calendar I
- Minimum Number of Refueling Stops
- Minimum Number of K Consecutive Bit Flips
- Decode String
- Swap Nodes in Pairs
- Find Minimum Time to Finish All Jobs
- Binary Tree Cameras
- Design File System
- Minimum Moves to Equal Array Elements II
- Walls and Gates
- Find Missing Observations
- Subsequence of Size K With the Largest Even Sum
- Contains Duplicate
- First Bad Version
- 2 Keys Keyboard
- Spiral Matrix II
- Longest Cycle in a Graph
- Next Permutation
- Equal Rational Numbers
- Remove K Digits
- Remove Duplicate Letters
- Merge k Sorted Lists
- Critical Connections in a Network
- Design Browser History
- Trapping Rain Water
- All Nodes Distance K in Binary Tree
- Group Anagrams
- Number of Flowers in Full Bloom
- Sort List
- Design Circular Queue
- Find the Longest Substring Containing Vowels in Even Counts
- Valid Tic-Tac-Toe State
- Insert Delete GetRandom O(1)
- Employees Earning More Than Their Managers
- Minimum Moves to Spread Stones Over Grid
- Sort Characters By Frequency
- Sliding Window Median
- Letter Combinations of a Phone Number
- Move Zeroes
- Pascal's Triangle II
- LFU Cache
- Removing Minimum Number of Magic Beans
- Sort Array By Parity II
- Check if One String Swap Can Make Strings Equal
- Parallel Courses II
- Dungeon Game
- Partition to K Equal Sum Subsets
- Reverse Words in a String
- Number of Operations to Make Network Connected
- The Knight’s Tour
- Max Consecutive Ones II
- Jump Game III
- K Closest Points to Origin
- Binary Search
- Maximum Frequency Stack
- 4Sum
- Shift 2D Grid
- Shortest Common Supersequence
- Binary Search Tree Iterator
- Smallest Number With Given Digit Product
- Validate Stack Sequences
- Palindrome Pairs
- Count Complete Tree Nodes
- Single Element in a Sorted Array
- Two Sum
- Climbing Stairs
- Maximum Product of Splitted Binary Tree
- Number of Islands
- LRU Cache
- Min Cost Climbing Stairs
- Add Digits
- Robot Room Cleaner
- Minimum Adjacent Swaps for K Consecutive Ones
- Fruit Into Baskets
- Wiggle Sort II
- Time Based Key-Value Store
- Minimum Sum of Squared Difference
- Flip Equivalent Binary Trees
- Three Divisors
- Unique Binary Search Trees II
- Image Overlap
- Longest Common Prefix
- Binary Tree Paths
- Find All Duplicates in an Array
- Set Matrix Zeroes
- Find K Closest Elements
- String Without AAA or BBB
- Next Closest Time
- Squares of a Sorted Array
- Minimum Cost to Separate Sentence Into Rows
- Burst Balloons
- Find All Numbers Disappeared in an Array
- Maximum Product of Three Numbers
- Find All Possible Recipes from Given Supplies
- Inorder Successor in BST
- Merge Sorted Array
- Container With Most Water
- Sort the Matrix Diagonally
- Minimum Fuel Cost to Report to the Capital
- Maximize Distance to Closest Person
- Sliding Window Maximum
- Remove Digit From Number to Maximize Result
- Remove Element
- Majority Element II
- Minimum Swaps to Group All 1's Together II
- Third Maximum Number
- Longest Consecutive Sequence
- Average of Levels in Binary Tree
- Binary Search Tree Iterator II
- Lowest Common Ancestor of a Binary Tree II
- Maximum Sum of Two Non-Overlapping Subarrays
- Convert Sorted List to Binary Search Tree
- Basic Calculator
- Non-overlapping Intervals
- Best Time to Buy and Sell Stock II
- Triangle
- Dot Product of Two Sparse Vectors
- Search a 2D Matrix II
- Find All Anagrams in a String
- Concatenated Words
- Maximum Average Subarray I
- Get the Second Most Recent Activity
- Maximum Depth of Binary Tree
- Minimum Operations to Halve Array Sum
- Top K Frequent Words
- Minimum Remove to Make Valid Parentheses
- Redundant Connection
- Valid Sudoku
- Assign Cookies
- Boats to Save People
- Fraction to Recurring Decimal
- Read N Characters Given read4 II - Call Multiple Times
- Min Stack
- Partition Labels
- Delete Node in a Linked List
- Find Pivot Index
- Count Odd Numbers in an Interval Range
- Divisor Game
- Permutation in String
- Design Excel Sum Formula
- Cheapest Flights Within K Stops
- Longest Substring with At Most K Distinct Characters
- Maximal Network Rank
- Integer to Roman
- Rearrange Spaces Between Words
- Construct Binary Search Tree from Preorder Traversal
- Reverse Words in a String III
- Valid Triangle Number
- Sum Root to Leaf Numbers
- Bus Routes
- Relative Ranks
- Shortest Unsorted Continuous Subarray
- Find Bottom Left Tree Value
- Find Center of Star Graph
- Excel Sheet Column Title
- Find the Start and End Number of Continuous Ranges
- Spiral Matrix III
- Duplicate Zeros
- Perfect Squares
- Flatten Binary Tree to Linked List
- Average Time of Process per Machine
- Largest BST Subtree
- Reverse Linked List II
- Odd Even Linked List
- House Robber
- Delete Node in a BST
- Max Points on a Line
- Combine Two Tables
- Wildcard Matching
- Reduction Operations to Make the Array Elements Equal
- Zigzag Conversion
- Subsets
- Optimal Partition of String
- Online Stock Span
- Minimum Common Value
- Add Binary
- Minimum Number of Arrows to Burst Balloons
- Two Sum IV - Input is a BST
- Network Delay Time
- Partition Array Into Three Parts With Equal Sum
- Linked List Cycle
- Binary Tree Right Side View
- Word Ladder
- Check if All A's Appears Before All B's
- Partition Equal Subset Sum
- Compare Version Numbers
- Verifying an Alien Dictionary
- Day of the Week
- Two Sum II - Input Array Is Sorted
- Implement Rand10() Using Rand7()
- Minimum Size Subarray Sum
- Search a 2D Matrix
- Reverse Nodes in k-Group
- Closest Binary Search Tree Value
- Reverse Vowels of a String
- Remove Duplicates from Sorted Array II
- Shortest Word Distance
- Employee Free Time
- Remove Duplicates from Sorted List II
- Binary Tree Maximum Path Sum
- As Far from Land as Possible
- Implement Stack using Queues
- H-Index
- Print Words Vertically
- Maximize Number of Nice Divisors
- Find the Winner of the Circular Game
- Minimum Number of Removals to Make Mountain Array
- Binary Tree Inorder Traversal
- Minesweeper
- Path Sum
- Defanging an IP Address
- Find Lucky Integer in an Array
- Reformat The String
- Find K Pairs with Smallest Sums
- Minimum Flips to Make a OR b Equal to c
- Minimum Deletions to Make String Balanced
- Knight Dialer
- Buildings With an Ocean View
- String Compression II
- Number of Distinct Binary Strings After Applying Operations
- Largest Divisible Subset
- House Robber II
- Shortest Distance from All Buildings
- Print in Order
- Maximum Units on a Truck
- Sudoku Solver
- Valid Palindrome
- Maximum Depth of N-ary Tree
- Serialize and Deserialize N-ary Tree
- Reorganize String
- Department Highest Salary
- Lowest Common Ancestor of a Binary Tree
- Recover a Tree From Preorder Traversal
- Swap For Longest Repeated Character Substring
- Statistics from a Large Sample
- Populating Next Right Pointers in Each Node
- Step-By-Step Directions From a Binary Tree Node to Another
- Spiral Matrix
- Palindrome Removal
- Minimum Number of Work Sessions to Finish the Tasks
- Minimum Number of Swaps to Make the String Balanced
- Word Frequency
- Isomorphic Strings
- Number of Distinct Islands
- Max Sum of a Pair With Equal Sum of Digits
- Vertical Order Traversal of a Binary Tree
- Kth Missing Positive Number
- Reordered Power of 2
- The Maze
- Next Greater Node In Linked List
- Jewels and Stones
- Permutations
- Search in Rotated Sorted Array
- Logger Rate Limiter
- Design Parking System
- Satisfiability of Equality Equations
- Same Tree
- Score of Parentheses
- Longest Arithmetic Subsequence
- Combination Sum IV
- Count Square Submatrices with All Ones
- Number of Closed Islands
- Find the Index of the First Occurrence in a String
- Second Highest Salary
- Populating Next Right Pointers in Each Node II
- Numbers With Same Consecutive Differences
- Factorial Trailing Zeroes
- Number of Students Doing Homework at a Given Time
- Furthest Building You Can Reach
- Single Number
- Nth Highest Salary
- Valid Anagram
- Linked List in Binary Tree
- Shortest Bridge
- Search in a Binary Search Tree
- Tag Validator
- Design Snake Game