Recent interview Questions for Amazon

Prepare better for microsoft

Hey, if you're thinking about acing that microsoft interview, we've got you covered! 🌟

We've gathered interview questions asked of candidates over the past six months from various sources.

The questions are currently in random order, but if you want them sorted from most frequently asked to less frequent, consider subscribing.

We'll send you personalized links to make your preparation even more tailored to your needs.

Best of luck with your interview journey! 🚀

  1. Gas Station
  2. 3Sum
  3. Find the Duplicate Number
  4. Super Washing Machines
  5. Maximum of Absolute Value Expression
  6. Max Dot Product of Two Subsequences
  7. Make the Prefix Sum Non-negative
  8. Implement Trie (Prefix Tree)
  9. Amount of Time for Binary Tree to Be Infected
  10. Construct Binary Tree from Inorder and Postorder Traversal
  11. Count Univalue Subtrees
  12. Number of Times Binary String Is Prefix-Aligned
  13. Product of Array Except Self
  14. Interleaving String
  15. Find Two Non-overlapping Sub-arrays Each With Target Sum
  16. Linked List Cycle II
  17. Random Pick with Weight
  18. Replace All ?'s to Avoid Consecutive Repeating Characters
  19. Count Servers that Communicate
  20. 3Sum Closest
  21. Minimum Number of Moves to Make Palindrome
  22. Subarray Sum Equals K
  23. Sum of Two Integers
  24. Stone Game IV
  25. Sum of Subarray Minimums
  26. Design Hit Counter
  27. Heaters
  28. Battleships in a Board
  29. Word Break
  30. Word Search II
  31. Clone Graph
  32. Design HashMap
  33. Counting Bits
  34. Frequency of the Most Frequent Element
  35. Smallest String With Swaps
  36. Day of the Year
  37. Number of Dice Rolls With Target Sum
  38. Palindrome Linked List
  39. Edit Distance
  40. Shuffle the Array
  41. Making A Large Island
  42. Max Pair Sum in an Array
  43. Shuffle String
  44. Largest Number
  45. Remove All Adjacent Duplicates In String
  46. Add Strings
  47. Regular Expression Matching
  48. Maximum Vacation Days
  49. Analyze User Website Visit Pattern
  50. Making File Names Unique
  51. Trim a Binary Search Tree
  52. Minimum Path Sum
  53. Cinema Seat Allocation
  54. Fibonacci Number
  55. Number of Connected Components in an Undirected Graph
  56. Can Place Flowers
  57. Reverse Linked List
  58. Find Minimum in Rotated Sorted Array II
  59. Minimum Moves to Equal Array Elements
  60. Evaluate Division
  61. Integer Break
  62. Unique Paths II
  63. Minimum Incompatibility
  64. Remove All Adjacent Duplicates in String II
  65. Letter Case Permutation
  66. Rearrange String k Distance Apart
  67. Split Array With Same Average
  68. Path Sum II
  69. Backspace String Compare
  70. Car Pooling
  71. Shortest Path Visiting All Nodes
  72. Flip String to Monotone Increasing
  73. Closest Dessert Cost
  74. Valid Parenthesis String
  75. Intersection of Two Linked Lists
  76. Minimum Knight Moves
  77. Search Insert Position
  78. Max Stack
  79. Water Bottles
  80. Invert Binary Tree
  81. Copy List with Random Pointer
  82. Minimum Window Substring
  83. Design In-Memory File System
  84. The Skyline Problem
  85. Meeting Rooms II
  86. Count Good Nodes in Binary Tree
  87. Max Consecutive Ones III
  88. Remove Duplicates From an Unsorted Linked List
  89. First Missing Positive
  90. Basic Calculator III
  91. Candy
  92. Minimum Deletions to Make Array Beautiful
  93. Find Minimum in Rotated Sorted Array
  94. Smallest Range Covering Elements from K Lists
  95. Number of Digit One
  96. Decode Ways
  97. Add Two Numbers II
  98. Majority Element
  99. Partition Array Into Two Arrays to Minimize Sum Difference
  100. Validate Binary Search Tree
  101. Valid Number
  102. Delete Tree Nodes
  103. Bulb Switcher II
  104. Minimum Deletions to Make Character Frequencies Unique
  105. Remove Linked List Elements
  106. Exclusive Time of Functions
  107. Predict the Winner
  108. Task Scheduler
  109. Permutations II
  110. Next Greater Element I
  111. Maximum Length of a Concatenated String with Unique Characters
  112. Lowest Common Ancestor of a Binary Tree III
  113. Rotate String
  114. Subarray Sums Divisible by K
  115. Create Hello World Function
  116. Substring with Concatenation of All Words
  117. Average Height of Buildings in Each Segment
  118. Distribute Coins in Binary Tree
  119. Subtree of Another Tree
  120. Excel Sheet Column Number
  121. Pow(x, n)
  122. Clumsy Factorial
  123. Merge Two Sorted Lists
  124. Find Median from Data Stream
  125. Running Sum of 1d Array
  126. Contiguous Array
  127. Web Crawler
  128. Longest Palindromic Subsequence
  129. Number of Subarrays with Bounded Maximum
  130. Maximum Value at a Given Index in a Bounded Array
  131. Capacity To Ship Packages Within D Days
  132. Coin Change II
  133. Number of Ways to Split a String
  134. Binary Tree Zigzag Level Order Traversal
  135. Number of Good Pairs
  136. Frog Jump
  137. Minimum Number of Days to Make m Bouquets
  138. Valid Square
  139. The Maze II
  140. Find All The Lonely Nodes
  141. Design Search Autocomplete System
  142. Intersection of Two Arrays II
  143. Widest Pair of Indices With Equal Range Sum
  144. Implement Queue using Stacks
  145. Recyclable and Low Fat Products
  146. Sum of Digits of String After Convert
  147. Reverse Integer
  148. Minimum Amount of Time to Collect Garbage
  149. Minimize the Maximum Difference of Pairs
  150. Reverse Words in a String II
  151. Inorder Successor in BST II
  152. Is Subsequence
  153. Alien Dictionary
  154. Lowest Common Ancestor of Deepest Leaves
  155. Longest Path With Different Adjacent Characters
  156. Reverse Pairs
  157. Generate Parentheses
  158. Find the Difference
  159. Plus One
  160. Integer to English Words
  161. Kth Smallest Element in a Sorted Matrix
  162. Pacific Atlantic Water Flow
  163. Longest Duplicate Substring
  164. Delete Operation for Two Strings
  165. 132 Pattern
  166. Largest Rectangle in Histogram
  167. Maximum Width of Binary Tree
  168. Merge Intervals
  169. Unique Paths
  170. Word Ladder II
  171. Recover Binary Search Tree
  172. Construct Binary Tree from Preorder and Inorder Traversal
  173. Palindrome Number
  174. Restore the Array From Adjacent Pairs
  175. Maximum Score Of Spliced Array
  176. Design Add and Search Words Data Structure
  177. Palindromic Substrings
  178. Longest Common Subsequence
  179. Shortest Path in Binary Matrix
  180. Reverse Substrings Between Each Pair of Parentheses
  181. Flood Fill
  182. Count Substrings That Differ by One Character
  183. Previous Permutation With One Swap
  184. Rotate Image
  185. Count Primes
  186. Path Sum III
  187. Find Distance in a Binary Tree
  188. Search in Rotated Sorted Array II
  189. Design A Leaderboard
  190. Root Equals Sum of Children
  191. Minimum Add to Make Parentheses Valid
  192. Possible Bipartition
  193. Ways to Split Array Into Three Subarrays
  194. Binary Tree Level Order Traversal
  195. Median of Two Sorted Arrays
  196. Minimum Time to Make Rope Colorful
  197. Combination Sum II
  198. Largest Palindromic Number
  199. Parallel Courses
  200. Find First and Last Position of Element in Sorted Array
  201. Diameter of Binary Tree
  202. Valid Palindrome II
  203. Number of Students Unable to Eat Lunch
  204. Jump Game II
  205. Maximum Population Year
  206. Combinations
  207. Find Leaves of Binary Tree
  208. Design Twitter
  209. Missing Number
  210. Maximum Length of Repeated Subarray
  211. Best Meeting Point
  212. Design Tic-Tac-Toe
  213. Longest Substring with At Least K Repeating Characters
  214. Number of Steps to Reduce a Number to Zero
  215. Find the Celebrity
  216. Remove Invalid Parentheses
  217. Insertion Sort List
  218. Insert into a Sorted Circular Linked List
  219. Longest Palindromic Substring
  220. Rotate List
  221. Lowest Common Ancestor of a Binary Search Tree
  222. Sort Array By Parity
  223. Snapshot Array
  224. Binary Tree Vertical Order Traversal
  225. Word Break II
  226. Course Schedule II
  227. Maximum Employees to Be Invited to a Meeting
  228. Greatest English Letter in Upper and Lower Case
  229. Guess the Word
  230. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
  231. Maximum Performance of a Team
  232. Egg Drop With 2 Eggs and N Floors
  233. Boundary of Binary Tree
  234. Widest Vertical Area Between Two Points Containing No Points
  235. Combination Sum
  236. Serialize and Deserialize BST
  237. Top K Frequent Elements
  238. Time Needed to Inform All Employees
  239. Middle of the Linked List
  240. Longest Substring Without Repeating Characters
  241. Merge Nodes in Between Zeros
  242. Split a String Into the Max Number of Unique Substrings
  243. Find And Replace in String
  244. N-Queens
  245. Merge Strings Alternately
  246. Coin Change
  247. Minimum Operations to Make Array Equal
  248. Kill Process
  249. Stream of Characters
  250. String to Integer (atoi)
  251. Rotate Array
  252. 4 Keys Keyboard
  253. Find if Path Exists in Graph
  254. The kth Factor of n
  255. Largest Positive Integer That Exists With Its Negative
  256. Maximum Product Subarray
  257. Game of Life
  258. Find N Unique Integers Sum up to Zero
  259. Text Justification
  260. Max Area of Island
  261. Count and Say
  262. Valid Perfect Square
  263. Design HashSet
  264. Find Smallest Common Element in All Rows
  265. Convert Sorted Array to Binary Search Tree
  266. Number of Days Between Two Dates
  267. Remove Comments
  268. Maximum Number of Balloons
  269. Bulls and Cows
  270. All the Matches of the League
  271. Remove Duplicates from Sorted List
  272. Kth Largest Element in a Stream
  273. Count Negative Numbers in a Sorted Matrix
  274. Best Time to Buy and Sell Stock
  275. Partition List
  276. Divide Two Integers
  277. Maximum Price to Fill a Bag
  278. Graph Valid Tree
  279. Find Winner on a Tic Tac Toe Game
  280. Car Fleet
  281. Contains Duplicate II
  282. Number of Matching Subsequences
  283. Sort an Array
  284. The k-th Lexicographical String of All Happy Strings of Length n
  285. Reverse String II
  286. Reverse String
  287. Russian Doll Envelopes
  288. Longest Mountain in Array
  289. Course Schedule
  290. Basic Calculator II
  291. Water and Jug Problem
  292. Jump Game
  293. Number of 1 Bits
  294. House Robber III
  295. Surrounded Regions
  296. Minimum Number of Taps to Open to Water a Garden
  297. Maximal Rectangle
  298. Flatten Nested List Iterator
  299. Buddy Strings
  300. Nim Game
  301. Next Greater Element III
  302. Serialize and Deserialize Binary Tree
  303. Length of Last Word
  304. Rectangle Overlap
  305. Restore IP Addresses
  306. Minimum Insertions to Balance a Parentheses String
  307. Roman to Integer
  308. Longest Substring with At Most Two Distinct Characters
  309. Pascal's Triangle
  310. Rotting Oranges
  311. Insert Interval
  312. Count of Smaller Numbers After Self
  313. Add Two Integers
  314. Wiggle Sort
  315. Longest Nice Substring
  316. Two City Scheduling
  317. Sign of the Product of an Array
  318. Counting Words With a Given Prefix
  319. Find Peak Element
  320. Angle Between Hands of a Clock
  321. Solve the Equation
  322. First Unique Character in a String
  323. Design Skiplist
  324. Reverse Bits
  325. Remove Max Number of Edges to Keep Graph Fully Traversable
  326. Maximal Square
  327. Longest Univalue Path
  328. Find Original Array From Doubled Array
  329. Word Search
  330. Shortest Path in a Grid with Obstacles Elimination
  331. Keys and Rooms
  332. String Compression
  333. Longest Word in Dictionary
  334. Delete N Nodes After M Nodes of a Linked List
  335. Simplify Path
  336. Minimum Cost to Cut a Stick
  337. Longest Increasing Path in a Matrix
  338. Interval List Intersections
  339. Daily Temperatures
  340. Multiply Strings
  341. Remove Outermost Parentheses
  342. Kth Smallest Element in a BST
  343. Min Cost to Connect All Points
  344. Delete the Middle Node of a Linked List
  345. Maximum Level Sum of a Binary Tree
  346. Maximum Subarray
  347. Max Chunks To Make Sorted II
  348. Number of Atoms
  349. Intersection of Two Arrays
  350. Missing Ranges
  351. Sqrt(x)
  352. Minimum Insertion Steps to Make a String Palindrome
  353. Design Linked List
  354. The Number of Full Rounds You Have Played
  355. Max Consecutive Ones
  356. Path With Minimum Effort
  357. Snakes and Ladders
  358. Remove Duplicates from Sorted Array
  359. Reorder List
  360. Evaluate Reverse Polish Notation
  361. Longest Happy String
  362. Valid Parentheses
  363. Happy Number
  364. Combination Sum III
  365. Nth Digit
  366. Matchsticks to Square
  367. Validate IP Address
  368. Equal Sum Arrays With Minimum Number of Operations
  369. Sort Colors
  370. Cousins in Binary Tree
  371. Bulb Switcher
  372. Maximum Profit in Job Scheduling
  373. Kth Largest Element in an Array
  374. Remove Nth Node From End of List
  375. Longest Increasing Subsequence
  376. Convert Binary Search Tree to Sorted Doubly Linked List
  377. Divide Array Into Equal Pairs
  378. Symmetric Tree
  379. Next Greater Element II
  380. Search Suggestions System
  381. Image Smoother
  382. Fizz Buzz
  383. 01 Matrix
  384. Diagonal Traverse
  385. Maximum Binary Tree
  386. Is Graph Bipartite?
  387. Asteroid Collision
  388. Number of Steps to Reduce a Number in Binary Representation to One
  389. Unique Binary Search Trees
  390. Number of Unique Flavors After Sharing K Candies
  391. Minimum Time Difference
  392. Add Two Numbers
  393. Longest Valid Parentheses
  394. Meeting Rooms
  395. My Calendar I
  396. Minimum Number of Refueling Stops
  397. Minimum Number of K Consecutive Bit Flips
  398. Decode String
  399. Swap Nodes in Pairs
  400. Find Minimum Time to Finish All Jobs
  401. Binary Tree Cameras
  402. Design File System
  403. Minimum Moves to Equal Array Elements II
  404. Walls and Gates
  405. Find Missing Observations
  406. Subsequence of Size K With the Largest Even Sum
  407. Contains Duplicate
  408. First Bad Version
  409. 2 Keys Keyboard
  410. Spiral Matrix II
  411. Longest Cycle in a Graph
  412. Next Permutation
  413. Equal Rational Numbers
  414. Remove K Digits
  415. Remove Duplicate Letters
  416. Merge k Sorted Lists
  417. Critical Connections in a Network
  418. Design Browser History
  419. Trapping Rain Water
  420. All Nodes Distance K in Binary Tree
  421. Group Anagrams
  422. Number of Flowers in Full Bloom
  423. Sort List
  424. Design Circular Queue
  425. Find the Longest Substring Containing Vowels in Even Counts
  426. Valid Tic-Tac-Toe State
  427. Insert Delete GetRandom O(1)
  428. Employees Earning More Than Their Managers
  429. Minimum Moves to Spread Stones Over Grid
  430. Sort Characters By Frequency
  431. Sliding Window Median
  432. Letter Combinations of a Phone Number
  433. Move Zeroes
  434. Pascal's Triangle II
  435. LFU Cache
  436. Removing Minimum Number of Magic Beans
  437. Sort Array By Parity II
  438. Check if One String Swap Can Make Strings Equal
  439. Parallel Courses II
  440. Dungeon Game
  441. Partition to K Equal Sum Subsets
  442. Reverse Words in a String
  443. Number of Operations to Make Network Connected
  444. The Knight’s Tour
  445. Max Consecutive Ones II
  446. Jump Game III
  447. K Closest Points to Origin
  448. Binary Search
  449. Maximum Frequency Stack
  450. 4Sum
  451. Shift 2D Grid
  452. Shortest Common Supersequence
  453. Binary Search Tree Iterator
  454. Smallest Number With Given Digit Product
  455. Validate Stack Sequences
  456. Palindrome Pairs
  457. Count Complete Tree Nodes
  458. Single Element in a Sorted Array
  459. Two Sum
  460. Climbing Stairs
  461. Maximum Product of Splitted Binary Tree
  462. Number of Islands
  463. LRU Cache
  464. Min Cost Climbing Stairs
  465. Add Digits
  466. Robot Room Cleaner
  467. Minimum Adjacent Swaps for K Consecutive Ones
  468. Fruit Into Baskets
  469. Wiggle Sort II
  470. Time Based Key-Value Store
  471. Minimum Sum of Squared Difference
  472. Flip Equivalent Binary Trees
  473. Three Divisors
  474. Unique Binary Search Trees II
  475. Image Overlap
  476. Longest Common Prefix
  477. Binary Tree Paths
  478. Find All Duplicates in an Array
  479. Set Matrix Zeroes
  480. Find K Closest Elements
  481. String Without AAA or BBB
  482. Next Closest Time
  483. Squares of a Sorted Array
  484. Minimum Cost to Separate Sentence Into Rows
  485. Burst Balloons
  486. Find All Numbers Disappeared in an Array
  487. Maximum Product of Three Numbers
  488. Find All Possible Recipes from Given Supplies
  489. Inorder Successor in BST
  490. Merge Sorted Array
  491. Container With Most Water
  492. Sort the Matrix Diagonally
  493. Minimum Fuel Cost to Report to the Capital
  494. Maximize Distance to Closest Person
  495. Sliding Window Maximum
  496. Remove Digit From Number to Maximize Result
  497. Remove Element
  498. Majority Element II
  499. Minimum Swaps to Group All 1's Together II
  500. Third Maximum Number
  501. Longest Consecutive Sequence
  502. Average of Levels in Binary Tree
  503. Binary Search Tree Iterator II
  504. Lowest Common Ancestor of a Binary Tree II
  505. Maximum Sum of Two Non-Overlapping Subarrays
  506. Convert Sorted List to Binary Search Tree
  507. Basic Calculator
  508. Non-overlapping Intervals
  509. Best Time to Buy and Sell Stock II
  510. Triangle
  511. Dot Product of Two Sparse Vectors
  512. Search a 2D Matrix II
  513. Find All Anagrams in a String
  514. Concatenated Words
  515. Maximum Average Subarray I
  516. Get the Second Most Recent Activity
  517. Maximum Depth of Binary Tree
  518. Minimum Operations to Halve Array Sum
  519. Top K Frequent Words
  520. Minimum Remove to Make Valid Parentheses
  521. Redundant Connection
  522. Valid Sudoku
  523. Assign Cookies
  524. Boats to Save People
  525. Fraction to Recurring Decimal
  526. Read N Characters Given read4 II - Call Multiple Times
  527. Min Stack
  528. Partition Labels
  529. Delete Node in a Linked List
  530. Find Pivot Index
  531. Count Odd Numbers in an Interval Range
  532. Divisor Game
  533. Permutation in String
  534. Design Excel Sum Formula
  535. Cheapest Flights Within K Stops
  536. Longest Substring with At Most K Distinct Characters
  537. Maximal Network Rank
  538. Integer to Roman
  539. Rearrange Spaces Between Words
  540. Construct Binary Search Tree from Preorder Traversal
  541. Reverse Words in a String III
  542. Valid Triangle Number
  543. Sum Root to Leaf Numbers
  544. Bus Routes
  545. Relative Ranks
  546. Shortest Unsorted Continuous Subarray
  547. Find Bottom Left Tree Value
  548. Find Center of Star Graph
  549. Excel Sheet Column Title
  550. Find the Start and End Number of Continuous Ranges
  551. Spiral Matrix III
  552. Duplicate Zeros
  553. Perfect Squares
  554. Flatten Binary Tree to Linked List
  555. Average Time of Process per Machine
  556. Largest BST Subtree
  557. Reverse Linked List II
  558. Odd Even Linked List
  559. House Robber
  560. Delete Node in a BST
  561. Max Points on a Line
  562. Combine Two Tables
  563. Wildcard Matching
  564. Reduction Operations to Make the Array Elements Equal
  565. Zigzag Conversion
  566. Subsets
  567. Optimal Partition of String
  568. Online Stock Span
  569. Minimum Common Value
  570. Add Binary
  571. Minimum Number of Arrows to Burst Balloons
  572. Two Sum IV - Input is a BST
  573. Network Delay Time
  574. Partition Array Into Three Parts With Equal Sum
  575. Linked List Cycle
  576. Binary Tree Right Side View
  577. Word Ladder
  578. Check if All A's Appears Before All B's
  579. Partition Equal Subset Sum
  580. Compare Version Numbers
  581. Verifying an Alien Dictionary
  582. Day of the Week
  583. Two Sum II - Input Array Is Sorted
  584. Implement Rand10() Using Rand7()
  585. Minimum Size Subarray Sum
  586. Search a 2D Matrix
  587. Reverse Nodes in k-Group
  588. Closest Binary Search Tree Value
  589. Reverse Vowels of a String
  590. Remove Duplicates from Sorted Array II
  591. Shortest Word Distance
  592. Employee Free Time
  593. Remove Duplicates from Sorted List II
  594. Binary Tree Maximum Path Sum
  595. As Far from Land as Possible
  596. Implement Stack using Queues
  597. H-Index
  598. Print Words Vertically
  599. Maximize Number of Nice Divisors
  600. Find the Winner of the Circular Game
  601. Minimum Number of Removals to Make Mountain Array
  602. Binary Tree Inorder Traversal
  603. Minesweeper
  604. Path Sum
  605. Defanging an IP Address
  606. Find Lucky Integer in an Array
  607. Reformat The String
  608. Find K Pairs with Smallest Sums
  609. Minimum Flips to Make a OR b Equal to c
  610. Minimum Deletions to Make String Balanced
  611. Knight Dialer
  612. Buildings With an Ocean View
  613. String Compression II
  614. Number of Distinct Binary Strings After Applying Operations
  615. Largest Divisible Subset
  616. House Robber II
  617. Shortest Distance from All Buildings
  618. Print in Order
  619. Maximum Units on a Truck
  620. Sudoku Solver
  621. Valid Palindrome
  622. Maximum Depth of N-ary Tree
  623. Serialize and Deserialize N-ary Tree
  624. Reorganize String
  625. Department Highest Salary
  626. Lowest Common Ancestor of a Binary Tree
  627. Recover a Tree From Preorder Traversal
  628. Swap For Longest Repeated Character Substring
  629. Statistics from a Large Sample
  630. Populating Next Right Pointers in Each Node
  631. Step-By-Step Directions From a Binary Tree Node to Another
  632. Spiral Matrix
  633. Palindrome Removal
  634. Minimum Number of Work Sessions to Finish the Tasks
  635. Minimum Number of Swaps to Make the String Balanced
  636. Word Frequency
  637. Isomorphic Strings
  638. Number of Distinct Islands
  639. Max Sum of a Pair With Equal Sum of Digits
  640. Vertical Order Traversal of a Binary Tree
  641. Kth Missing Positive Number
  642. Reordered Power of 2
  643. The Maze
  644. Next Greater Node In Linked List
  645. Jewels and Stones
  646. Permutations
  647. Search in Rotated Sorted Array
  648. Logger Rate Limiter
  649. Design Parking System
  650. Satisfiability of Equality Equations
  651. Same Tree
  652. Score of Parentheses
  653. Longest Arithmetic Subsequence
  654. Combination Sum IV
  655. Count Square Submatrices with All Ones
  656. Number of Closed Islands
  657. Find the Index of the First Occurrence in a String
  658. Second Highest Salary
  659. Populating Next Right Pointers in Each Node II
  660. Numbers With Same Consecutive Differences
  661. Factorial Trailing Zeroes
  662. Number of Students Doing Homework at a Given Time
  663. Furthest Building You Can Reach
  664. Single Number
  665. Nth Highest Salary
  666. Valid Anagram
  667. Linked List in Binary Tree
  668. Shortest Bridge
  669. Search in a Binary Search Tree
  670. Tag Validator
  671. Design Snake Game