Microsoft Leetcode

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26
At a glance
Powered by AI
The document provides statistics on questions asked in interviews for Microsoft over the last 6 months, including title, acceptance rate and difficulty level.

Some of the most common questions asked based on total questions and acceptance rate include Number of Good Pairs, Number of Steps to Reduce a Number to Zero, Reverse Words in a String III, and Find N Unique Integers Sum up to Zero.

The majority of questions listed fall into the Easy category, with difficulty levels ranging from Easy to Hard and acceptance rates generally decreasing as difficulty increases.

TAGGED PROBLEMS FROM

MUST SAVE AND SHARE


SDE SHEET (for Microsoft)
Questions asked in Last 6 Months

Total Question : 373

Difficulty: Arranged in ascending order

# Title Acceptance Difficulty

1512 Number of Good Pairs 88.0% Easy

1342 Number of Steps to Reduce a Number to 86.0% Easy

Zero

557 Reverse Words in a String III 79.2% Easy

1304 Find N Unique Integers Sum up to Zero 77.0% Easy

905 Sort Array By Parity 75.7% Easy

344 Reverse String 75.2% Easy

359 Logger Rate Limiter 75.2% Easy

1351 Count Negative Numbers in a Sorted 75.2% Easy

Matrix

876 Middle of the Linked List 72.9% Easy

237 Delete Node in a Linked List 72.4% Easy

Join telegram.me/sahebcse Community for Better Discussion !


104 Maximum Depth of Binary Tree 72.2% Easy

226 Invert Binary Tree 72.0% Easy

977 Squares of a Sorted Array 71.7% Easy

94 Binary Tree Inorder Traversal 71.2% Easy

1047 Remove All Adjacent Duplicates In String 70.9% Easy

206 Reverse Linked List 70.8% Easy

496 Next Greater Element I 70.4% Easy

136 Single Number 69.6% Easy

349 Intersection of Two Arrays 69.4% Easy

637 Average of Levels in Binary Tree 68.9% Easy

509 Fibonacci Number 68.3% Easy

412 Fizz Buzz 67.1% Easy

1822 Sign of the Product of an Array 67.1% Easy

705 Design HashSet 66.3% Easy

118 Pascal's Triangle 65.5% Easy

706 Design HashMap 65.2% Easy

169 Majority Element 63.2% Easy

Join telegram.me/sahebcse Community for Better Discussion !


1763 Longest Nice Substring 61.9% Easy

242 Valid Anagram 61.7% Easy

217 Contains Duplicate 61.0% Easy

171 Excel Sheet Column Number 60.8% Easy

283 Move Zeroes 60.8% Easy

21 Merge Two Sorted Lists 60.7% Easy

268 Missing Number 60.6% Easy

448 Find All Numbers Disappeared in an 59.2% Easy

Array

257 Binary Tree Paths 59.1% Easy

119 Pascal's Triangle II 58.1% Easy

13 Roman to Integer 57.9% Easy

387 First Unique Character in a String 57.4% Easy

292 Nim Game 55.6% Easy

1539 Kth Missing Positive Number 55.6% Easy

704 Binary Search 55.2% Easy

703 Kth Largest Element in a Stream 55.0% Easy

Join telegram.me/sahebcse Community for Better Discussion !


543 Diameter of Binary Tree 54.7% Easy

1275 Find Winner on a Tic Tac Toe Game 54.6% Easy

661 Image Smoother 54.5% Easy

121 Best Time to Buy and Sell Stock 54.2% Easy

993 Cousins in Binary Tree 53.9% Easy

415 Add Strings 52.3% Easy

101 Symmetric Tree 51.9% Easy

160 Intersection of Two Linked Lists 51.6% Easy

70 Climbing Stairs 51.2% Easy

155 Min Stack 50.6% Easy

190 Reverse Bits 49.7% Easy

53 Maximum Subarray 49.6% Easy

26 Remove Duplicates from Sorted Array 49.3% Easy

83 Remove Duplicates from Sorted List 49.2% Easy

1 Two Sum 48.7% Easy

234 Palindrome Linked List 47.1% Easy

628 Maximum Product of Three Numbers 46.7% Easy

Join telegram.me/sahebcse Community for Better Discussion !


2259 Remove Digit From Number to Maximize 46.7% Easy

Result

141 Linked List Cycle 46.1% Easy

112 Path Sum 45.9% Easy

572 Subtree of Another Tree 45.5% Easy

716 Max Stack 45.2% Easy

88 Merge Sorted Array 44.9% Easy

203 Remove Linked List Elements 43.8% Easy

125 Valid Palindrome 42.2% Easy

205 Isomorphic Strings 42.2% Easy

278 First Bad Version 42.0% Easy

20 Valid Parentheses 40.9% Easy

219 Contains Duplicate II 40.7% Easy

14 Longest Common Prefix 39.7% Easy

680 Valid Palindrome II 39.4% Easy

58 Length of Last Word 38.3% Easy

69 Sqrt(x) 36.6% Easy

Join telegram.me/sahebcse Community for Better Discussion !


28 Implement strStr() 36.3% Easy

168 Excel Sheet Column Title 34.1% Easy

1570 Dot Product of Two Sparse Vectors 90.2% Medium

1329 Sort the Matrix Diagonally 81.4% Medium

1008 Construct Binary Search Tree from 80.4% Medium

Preorder Traversal

1762 Buildings With an Ocean View 79.7% Medium

366 Find Leaves of Binary Tree 79.0% Medium

1650 Lowest Common Ancestor of a Binary 77.4% Medium

Tree III

921 Minimum Add to Make Parentheses Valid 76.9% Medium

419 Battleships in a Board 73.9% Medium

1448 Count Good Nodes in Binary Tree 73.0% Medium

46 Permutations 72.9% Medium

442 Find All Duplicates in an Array 72.7% Medium

78 Subsets 72.0% Medium

979 Distribute Coins in Binary Tree 71.7% Medium

Join telegram.me/sahebcse Community for Better Discussion !


986 Interval List Intersections 71.3% Medium

22 Generate Parentheses 70.5% Medium

695 Max Area of Island 70.1% Medium

1884 Egg Drop With 2 Eggs and N Floors 70.0% Medium

1836 Remove Duplicates From an Unsorted 69.1% Medium

Linked List

1244 Design A Leaderboard 68.2% Medium

230 Kth Smallest Element in a BST 68.0% Medium

451 Sort Characters By Frequency 68.0% Medium

1963 Minimum Number of Swaps to Make the 67.8% Medium

String Balanced

173 Binary Search Tree Iterator 67.7% Medium

362 Design Hit Counter 67.6% Medium

582 Kill Process 67.4% Medium

48 Rotate Image 67.3% Medium

739 Daily Temperatures 67.3% Medium

669 Trim a Binary Search Tree 66.3% Medium

Join telegram.me/sahebcse Community for Better Discussion !


39 Combination Sum 66.1% Medium

973 K Closest Points to Origin 65.9% Medium

1236 Web Crawler 65.8% Medium

1190 Reverse Substrings Between Each Pair 65.8% Medium

of Parentheses

1249 Minimum Remove to Make Valid 65.7% Medium

Parentheses

289 Game of Life 65.6% Medium

347 Top K Frequent Elements 65.0% Medium

529 Minesweeper 64.9% Medium

49 Group Anagrams 64.6% Medium

77 Combinations 64.5% Medium

426 Convert Binary Search Tree to Sorted 64.5% Medium

Doubly Linked List

238 Product of Array Except Self 64.2% Medium

215 Kth Largest Element in an Array 63.9% Medium

1011 Capacity To Ship Packages Within D 63.8% Medium

Days

Join telegram.me/sahebcse Community for Better Discussion !


1254 Number of Closed Islands 63.6% Medium

1344 Angle Between Hands of a Clock 63.4% Medium

1004 Max Consecutive Ones III 63.1% Medium

1306 Jump Game III 62.9% Medium

122 Best Time to Buy and Sell Stock II 62.3% Medium

1166 Design File System 61.8% Medium

323 Number of Connected Components in an 61.4% Medium

Undirected Graph

510 Inorder Successor in BST II 61.4% Medium

684 Redundant Connection 61.4% Medium

863 All Nodes Distance K in Binary Tree 61.4% Medium

102 Binary Tree Level Order Traversal 61.3% Medium

1578 Minimum Time to Make Rope Colorful 61.3% Medium

341 Flatten Nested List Iterator 60.9% Medium

636 Exclusive Time of Functions 60.5% Medium

62 Unique Paths 60.4% Medium

694 Number of Distinct Islands 60.1% Medium

Join telegram.me/sahebcse Community for Better Discussion !


199 Binary Tree Right Side View 59.9% Medium

378 Kth Smallest Element in a Sorted Matrix 59.9% Medium

12 Integer to Roman 59.7% Medium

64 Minimum Path Sum 59.7% Medium

516 Longest Palindromic Subsequence 59.7% Medium

286 Walls and Gates 59.6% Medium

24 Swap Nodes in Pairs 59.1% Medium

926 Flip String to Monotone Increasing 59.1% Medium

1143 Longest Common Subsequence 59.0% Medium

287 Find the Duplicate Number 58.9% Medium

445 Add Two Numbers II 58.9% Medium

208 Implement Trie (Prefix Tree) 58.8% Medium

1267 Count Servers that Communicate 58.7% Medium

540 Single Element in a Sorted Array 58.6% Medium

114 Flatten Binary Tree to Linked List 58.3% Medium

105 Construct Binary Tree from Preorder and 58.2% Medium

Inorder Traversal

Join telegram.me/sahebcse Community for Better Discussion !


1094 Car Pooling 57.9% Medium

116 Populating Next Right Pointers in Each 57.7% Medium

Node

1653 Minimum Deletions to Make String 57.6% Medium

Balanced

129 Sum Root to Leaf Numbers 57.4% Medium

348 Design Tic-Tac-Toe 57.3% Medium

1615 Maximal Network Rank 57.3% Medium

462 Minimum Moves to Equal Array Elements 57.2% Medium

II

498 Diagonal Traverse 57.2% Medium

1405 Longest Happy String 56.8% Medium

394 Decode String 56.5% Medium

449 Serialize and Deserialize BST 56.4% Medium

1647 Minimum Deletions to Make Character 56.4% Medium

Frequencies Unique

1209 Remove All Adjacent Duplicates in String 56.2% Medium

II

Join telegram.me/sahebcse Community for Better Discussion !


109 Convert Sorted List to Binary Search 56.0% Medium

Tree

236 Lowest Common Ancestor of a Binary 55.8% Medium

Tree

47 Permutations II 55.7% Medium

36 Valid Sudoku 55.5% Medium

75 Sort Colors 55.4% Medium

250 Count Univalue Subtrees 54.9% Medium

490 The Maze 54.9% Medium

17 Letter Combinations of a Phone Number 54.5% Medium

692 Top K Frequent Words 54.5% Medium

113 Path Sum II 54.4% Medium

200 Number of Islands 54.4% Medium

11 Container With Most Water 54.0% Medium

103 Binary Tree Zigzag Level Order Traversal 54.0% Medium

934 Shortest Bridge 53.1% Medium

159 Longest Substring with At Most Two 52.9% Medium

Distinct Characters

Join telegram.me/sahebcse Community for Better Discussion !


120 Triangle 52.7% Medium

40 Combination Sum II 52.6% Medium

981 Time Based Key-Value Store 52.6% Medium

148 Sort List 52.5% Medium

881 Boats to Save People 52.5% Medium

279 Perfect Squares 52.0% Medium

1775 Equal Sum Arrays With Minimum Number 52.0% Medium

of Operations

994 Rotting Oranges 51.9% Medium

380 Insert Delete GetRandom O(1) 51.5% Medium

505 The Maze II 51.5% Medium

186 Reverse Words in a String II 51.4% Medium

314 Binary Tree Vertical Order Traversal 51.4% Medium

1404 Number of Steps to Reduce a Number in 50.9% Medium

Binary Representation to One

486 Predict the Winner 50.4% Medium

743 Network Delay Time 50.4% Medium

Join telegram.me/sahebcse Community for Better Discussion !


95 Unique Binary Search Trees II 50.0% Medium

437 Path Sum III 50.0% Medium

253 Meeting Rooms II 49.9% Medium

300 Longest Increasing Subsequence 49.8% Medium

377 Combination Sum IV 49.7% Medium

1541 Minimum Insertions to Balance a 49.4% Medium

Parentheses String

450 Delete Node in a BST 49.2% Medium

99 Recover Binary Search Tree 49.0% Medium

73 Set Matrix Zeroes 48.8% Medium

128 Longest Consecutive Sequence 48.8% Medium

622 Design Circular Queue 48.8% Medium

117 Populating Next Right Pointers in Each 48.7% Medium

Node II

138 Copy List with Random Pointer 48.7% Medium

143 Reorder List 48.7% Medium

240 Search a 2D Matrix II 48.7% Medium

Join telegram.me/sahebcse Community for Better Discussion !


435 Non-overlapping Intervals 48.6% Medium

2096 Step-By-Step Directions From a Binary 48.6% Medium

Tree Node to Another

438 Find All Anagrams in a String 48.5% Medium

133 Clone Graph 48.4% Medium

153 Find Minimum in Rotated Sorted Array 48.1% Medium

443 String Compression 47.8% Medium

886 Possible Bipartition 47.7% Medium

184 Department Highest Salary 47.6% Medium

198 House Robber 47.6% Medium

285 Inorder Successor in BST 47.5% Medium

319 Bulb Switcher 47.5% Medium

340 Longest Substring with At Most K 47.5% Medium

Distinct Characters

849 Maximize Distance to Closest Person 47.5% Medium

967 Numbers With Same Consecutive 47.5% Medium

Differences

16 3Sum Closest 47.0% Medium

Join telegram.me/sahebcse Community for Better Discussion !


210 Course Schedule II 46.9% Medium

277 Find the Celebrity 46.9% Medium

1546 Maximum Number of Non-Overlapping 46.9% Medium

Subarrays With Sum Equals Target

470 Implement Rand10() Using Rand7() 46.8% Medium

416 Partition Equal Subset Sum 46.5% Medium

525 Contiguous Array 46.5% Medium

681 Next Closest Time 46.4% Medium

528 Random Pick with Weight 46.2% Medium

261 Graph Valid Tree 46.1% Medium

1774 Closest Dessert Cost 46.1% Medium

1156 Swap For Longest Repeated Character 46.0% Medium

Substring

1642 Furthest Building You Can Reach 45.3% Medium

56 Merge Intervals 45.2% Medium

74 Search a 2D Matrix 45.1% Medium

207 Course Schedule 45.1% Medium

Join telegram.me/sahebcse Community for Better Discussion !


139 Word Break 44.8% Medium

82 Remove Duplicates from Sorted List II 44.6% Medium

395 Longest Substring with At Least K 44.6% Medium

Repeating Characters

134 Gas Station 44.5% Medium

567 Permutation in String 44.4% Medium

1091 Shortest Path in Binary Matrix 44.4% Medium

735 Asteroid Collision 44.3% Medium

560 Subarray Sum Equals K 44.2% Medium

316 Remove Duplicate Letters 44.0% Medium

211 Design Add and Search Words Data 43.9% Medium

Structure

542 01 Matrix 43.9% Medium

593 Valid Square 43.9% Medium

209 Minimum Size Subarray Sum 43.7% Medium

221 Maximal Square 43.7% Medium

92 Reverse Linked List II 43.6% Medium

Join telegram.me/sahebcse Community for Better Discussion !


545 Boundary of Binary Tree 43.5% Medium

150 Evaluate Reverse Polish Notation 43.1% Medium

229 Majority Element II 42.8% Medium

984 String Without AAA or BBB 42.6% Medium

93 Restore IP Addresses 42.2% Medium

54 Spiral Matrix 41.9% Medium

227 Basic Calculator II 41.7% Medium

322 Coin Change 40.7% Medium

909 Snakes and Ladders 40.6% Medium

34 Find First and Last Position of Element in 40.3% Medium

Sorted Array

662 Maximum Width of Binary Tree 40.3% Medium

146 LRU Cache 40.1% Medium

1386 Cinema Seat Allocation 40.0% Medium

845 Longest Mountain in Array 39.9% Medium

79 Word Search 39.8% Medium

2 Add Two Numbers 38.9% Medium

Join telegram.me/sahebcse Community for Better Discussion !


189 Rotate Array 38.7% Medium

19 Remove Nth Node From End of List 38.6% Medium

63 Unique Paths II 38.6% Medium

33 Search in Rotated Sorted Array 38.0% Medium

43 Multiply Strings 38.0% Medium

274 H-Index 37.8% Medium

57 Insert Interval 37.6% Medium

18 4Sum 37.5% Medium

45 Jump Game II 37.5% Medium

1146 Snapshot Array 37.1% Medium

1477 Find Two Non-overlapping Sub-arrays 36.9% Medium

Each With Target Sum

31 Next Permutation 36.6% Medium

581 Shortest Unsorted Continuous Subarray 36.1% Medium

787 Cheapest Flights Within K Stops 35.9% Medium

475 Heaters 35.5% Medium

794 Valid Tic-Tac-Toe State 35.2% Medium

Join telegram.me/sahebcse Community for Better Discussion !


61 Rotate List 35.1% Medium

1487 Making File Names Unique 35.1% Medium

165 Compare Version Numbers 34.8% Medium

152 Maximum Product Subarray 34.6% Medium

708 Insert into a Sorted Circular Linked List 34.4% Medium

907 Sum of Subarray Minimums 34.0% Medium

556 Next Greater Element III 33.9% Medium

3 Longest Substring Without Repeating 33.4% Medium

Characters

179 Largest Number 33.2% Medium

204 Count Primes 33.0% Medium

50 Pow(x, n) 32.5% Medium

5 Longest Palindromic Substring 32.2% Medium

1986 Minimum Number of Work Sessions to 32.1% Medium

Finish the Tasks

15 3Sum 31.4% Medium

98 Validate Binary Search Tree 30.7% Medium

Join telegram.me/sahebcse Community for Better Discussion !


91 Decode Ways 30.6% Medium

402 Remove K Digits 30.5% Medium

151 Reverse Words in a String 29.0% Medium

707 Design Linked List 27.1% Medium

7 Reverse Integer 26.8% Medium

468 Validate IP Address 26.3% Medium

192 Word Frequency 25.6% Medium

166 Fraction to Recurring Decimal 23.7% Medium

29 Divide Two Integers 17.5% Medium

8 String to Integer (atoi) 16.6% Medium

759 Employee Free Time 71.3% Hard

428 Serialize and Deserialize N-ary Tree 64.6% Hard

847 Shortest Path Visiting All Nodes 61.4% Hard

51 N-Queens 60.6% Hard

296 Best Meeting Point 59.5% Hard

42 Trapping Rain Water 57.0% Hard

312 Burst Balloons 56.5% Hard

Join telegram.me/sahebcse Community for Better Discussion !


37 Sudoku Solver 54.7% Hard

297 Serialize and Deserialize Binary Tree 54.1% Hard

768 Max Chunks To Make Sorted II 52.2% Hard

25 Reverse Nodes in k-Group 51.7% Hard

72 Edit Distance 51.3% Hard

1032 Stream of Characters 51.3% Hard

995 Minimum Number of K Consecutive Bit 51.0% Hard

Flips

1235 Maximum Profit in Job Scheduling 50.9% Hard

295 Find Median from Data Stream 50.5% Hard

588 Design In-Memory File System 48.5% Hard

642 Design Search Autocomplete System 48.4% Hard

1326 Minimum Number of Taps to Open to 48.0% Hard

Water a Garden

772 Basic Calculator III 47.8% Hard

23 Merge k Sorted Lists 47.4% Hard

239 Sliding Window Maximum 46.3% Hard

Join telegram.me/sahebcse Community for Better Discussion !


815 Bus Routes 45.3% Hard

568 Maximum Vacation Days 44.6% Hard

1293 Shortest Path in a Grid with Obstacles 43.6% Hard

Elimination

472 Concatenated Words 43.5% Hard

968 Binary Tree Cameras 43.5% Hard

317 Shortest Distance from All Buildings 43.2% Hard

403 Frog Jump 43.0% Hard

843 Guess the Word 42.8% Hard

1723 Find Minimum Time to Finish All Jobs 42.8% Hard

140 Word Break II 42.6% Hard

315 Count of Smaller Numbers After Self 42.0% Hard

987 Vertical Order Traversal of a Binary Tree 41.8% Hard

84 Largest Rectangle in Histogram 41.1% Hard

158 Read N Characters Given read4 II - Call 41.1% Hard

Multiple Times

480 Sliding Window Median 41.1% Hard

Join telegram.me/sahebcse Community for Better Discussion !


224 Basic Calculator 40.7% Hard

460 LFU Cache 39.7% Hard

517 Super Washing Machines 39.6% Hard

76 Minimum Window Substring 39.3% Hard

218 The Skyline Problem 38.9% Hard

124 Binary Tree Maximum Path Sum 37.8% Hard

212 Word Search II 37.7% Hard

358 Rearrange String k Distance Apart 37.2% Hard

41 First Missing Positive 36.1% Hard

127 Word Ladder 35.7% Hard

68 Text Justification 35.6% Hard

269 Alien Dictionary 35.0% Hard

4 Median of Two Sorted Arrays 34.4% Hard

233 Number of Digit One 33.8% Hard

32 Longest Valid Parentheses 32.3% Hard

1044 Longest Duplicate Substring 31.0% Hard

493 Reverse Pairs 30.2% Hard

Join telegram.me/sahebcse Community for Better Discussion !


273 Integer to English Words 29.7% Hard

10 Regular Expression Matching 28.3% Hard

30 Substring with Concatenation of All 28.3% Hard

Words

126 Word Ladder II 27.2% Hard

44 Wildcard Matching 26.6% Hard

149 Max Points on a Line 20.8% Hard

2035 Partition Array Into Two Arrays to 20.3% Hard

Minimize Sum Difference

Join telegram.me/sahebcse Community for Better Discussion !

You might also like