← Microsoft roles

Interview question tracker

Microsoft Coding Interview Questions — Last 6 months

Practice 491 coding questions from Microsoft company-tagged LeetCode lists in the source’s last 6 months reporting window. Explore reported interview questions and track your progress.

Company-wide data from Fahad7177-jeh/leetcode-company-wise-questions; see its AGPL-3.0 license. All-time questions also use dataengineervishal/leetcode-companywise-questions (MIT license).

Reporting periods reflect source data, not verified interview dates. Questions can recur; inclusion does not guarantee they will appear in your interview.

Updated weekly · Latest source check: ⓘLatest successful check of the sources used by this company. A check does not necessarily mean the questions changed.

One question at a time.

Top questions 491

DoneQuestionLeetCode
Two SumSolve
3SumSolve
Add Two NumbersSolve
Best Time to Buy and Sell StockSolve
Group AnagramsSolve
Longest Palindromic SubstringSolve
Longest Substring Without Repeating CharactersSolve
LRU CacheSolve
Median of Two Sorted ArraysSolve
Merge IntervalsSolve
Remove Duplicates from Sorted ArraySolve
Roman to IntegerSolve
Subarray Sum Equals KSolve
Trapping Rain WaterSolve
Valid ParenthesesSolve
Container With Most WaterSolve
Design Authentication ManagerSolve
Find Peak ElementSolve
Generate ParenthesesSolve
Koko Eating BananasSolve
Longest Common PrefixSolve
Majority ElementSolve
Maximum SubarraySolve
Merge Sorted ArraySolve
Merge Two Sorted ListsSolve
Minimum Edge Reversals So Every Node Is ReachableSolve
Minimum Operations to Reduce an Integer to 0Solve
Next PermutationSolve
Number of IslandsSolve
Palindrome NumberSolve
Reverse Nodes in k-GroupSolve
Rotate ImageSolve
Search in Rotated Sorted ArraySolve
Serialize and Deserialize Binary TreeSolve
Spiral MatrixSolve
Arranging CoinsSolve
Binary Tree Level Order TraversalSolve
Climbing StairsSolve
Coin ChangeSolve
Contains DuplicateSolve
Count Palindromic SubsequencesSolve
Count the Number of Infection SequencesSolve
Course Schedule IISolve
Daily TemperaturesSolve
Decode StringSolve
Find First and Last Position of Element in Sorted ArraySolve
Find Median from Data StreamSolve
Find Minimum in Rotated Sorted ArraySolve
Find the Index of the First Occurrence in a StringSolve
First Missing PositiveSolve
Gas StationSolve
Happy NumberSolve
House RobberSolve
Jump Game IISolve
Largest Rectangle in HistogramSolve
Linked List CycleSolve
Longest Consecutive SequenceSolve
Longest Repeating Character ReplacementSolve
Lowest Common Ancestor of a Binary TreeSolve
Max Consecutive Ones IIISolve
Maximum Depth of Binary TreeSolve
Meeting Rooms IISolve
Merge k Sorted ListsSolve
Minimum Difficulty of a Job ScheduleSolve
Minimum Size Subarray SumSolve
Move ZeroesSolve
N-QueensSolve
Number of ProvincesSolve
Pascal's TriangleSolve
PermutationsSolve
Product of Array Except SelfSolve
Ransom NoteSolve
Regular Expression MatchingSolve
Remove Nth Node From End of ListSolve
Restore IP AddressesSolve
Reverse IntegerSolve
Reverse Linked ListSolve
Reverse Words in a StringSolve
Rising TemperatureSolve
Rotate ArraySolve
Rotting OrangesSolve
Search Insert PositionSolve
Single Element in a Sorted ArraySolve
Sliding Window MaximumSolve
Sort ColorsSolve
Split Array Largest SumSolve
Sqrt(x)Solve
String to Integer (atoi)Solve
Top K Frequent ElementsSolve
Valid AnagramSolve
Valid PalindromeSolve
Valid SudokuSolve
Valid WordSolve
Accounts MergeSolve
Add BinarySolve
Add StringsSolve
Add Two IntegersSolve
Asteroid CollisionSolve
Average Time of Process per MachineSolve
Backspace String CompareSolve
Battleships in a BoardSolve
Best Time to Buy and Sell Stock IISolve
Best Time to Buy and Sell Stock IIISolve
Binary SearchSolve
Binary Tree Inorder TraversalSolve
Binary Tree Zigzag Level Order TraversalSolve
Calculate Money in Leetcode BankSolve
Can Place FlowersSolve
Check if Array Is Sorted and RotatedSolve
Combination SumSolve
Combine Two TablesSolve
Convert Integer to the Sum of Two No-Zero IntegersSolve
Convert Sorted Array to Binary Search TreeSolve
Copy List with Random PointerSolve
Count Good NumbersSolve
Course ScheduleSolve
Customer Who Visited but Did Not Make Any TransactionsSolve
Delete Node in a Linked ListSolve
Design HashMapSolve
Design Memory AllocatorSolve
Diagonal TraverseSolve
Divide Two IntegersSolve
Edit DistanceSolve
Employees Earning More Than Their ManagersSolve
Evaluate Reverse Polish NotationSolve
Excel Sheet Column NumberSolve
Fibonacci NumberSolve
Final Prices With a Special Discount in a ShopSolve
Find All Anagrams in a StringSolve
Find All Duplicates in an ArraySolve
Find K Closest ElementsSolve
Find the Duplicate NumberSolve
Find the Original Typed String IISolve
Find the Winner of an Array GameSolve
First Unique Character in a StringSolve
Fizz BuzzSolve
Frequency of the Most Frequent ElementSolve
Game Play Analysis IVSolve
Height CheckerSolve
House Robber IISolve
Implement Stack using QueuesSolve
Implement Trie (Prefix Tree)Solve
Integer to RomanSolve
Intersection of Two ArraysSolve
Jump GameSolve
Kth Largest Element in an ArraySolve
Kth Smallest Element in a BSTSolve
Largest NumberSolve
Letter Combinations of a Phone NumberSolve
Linked List Cycle IISolve
Longest Common SubsequenceSolve
Longest Increasing SubsequenceSolve
Longest Palindromic SubsequenceSolve
Longest Valid ParenthesesSolve
Making A Large IslandSolve
Max Consecutive OnesSolve
Maximal RectangleSolve
Maximum Difference Between Even and Odd Frequency ISolve
Maximum Number of AlloysSolve
Maximum Number of Events That Can Be AttendedSolve
Maximum ORSolve
Maximum Product SubarraySolve
Middle of the Linked ListSolve
Min StackSolve
Minimum Absolute DifferenceSolve
Minimum Initial Energy to Finish TasksSolve
Minimum Knight MovesSolve
Minimum Number of Steps to Make Two Strings AnagramSolve
Minimum Operations to Make Array Equal to TargetSolve
Minimum Path SumSolve
Minimum Value to Get Positive Step by Step SumSolve
Multiply StringsSolve
Next Greater Element ISolve
Odd Even Linked ListSolve
Online Stock SpanSolve
Palindrome PartitioningSolve
Palindromic SubstringsSolve
Partition Equal Subset SumSolve
Peak Index in a Mountain ArraySolve
Perfect NumberSolve
Perfect SquaresSolve
Permutation in StringSolve
Permutations IISolve
Populating Next Right Pointers in Each NodeSolve
Pow(x, n)Solve
Rearranging FruitsSolve
Recover Binary Search TreeSolve
Recyclable and Low Fat ProductsSolve
Remove ElementSolve
Reverse Linked List IISolve
Rotate ListSolve
Running Sum of 1d ArraySolve
Same TreeSolve
Second Highest SalarySolve
Set Matrix ZeroesSolve
Shifting LettersSolve
Simplify PathSolve
Single NumberSolve
Smallest String With SwapsSolve
Sort ListSolve
Special Binary StringSolve
String CompressionSolve
Subarray Sums Divisible by KSolve
Subarrays with K Different IntegersSolve
Subsets IISolve
Sudoku SolverSolve
Task SchedulerSolve
Two Sum II - Input Array Is SortedSolve
Validate Binary Search TreeSolve
Vowel SpellcheckerSolve
Wildcard MatchingSolve
Word BreakSolve
Word LadderSolve
Word SearchSolve
Word Search IISolve
01 MatrixSolve
24 GameSolve
4SumSolve
Actors and Directors Who Cooperated At Least Three TimesSolve
Add DigitsSolve
Add Two Numbers IISolve
Alice and Bob Playing Flower GameSolve
All Nodes Distance K in Binary TreeSolve
Article Views ISolve
As Far from Land as PossibleSolve
Assign CookiesSolve
Average Selling PriceSolve
Balanced Binary TreeSolve
Basic CalculatorSolve
Big CountriesSolve
Binary Subarrays With SumSolve
Binary Tree Preorder TraversalSolve
Binary Tree Right Side ViewSolve
Binary Tree Vertical Order TraversalSolve
Bitwise ORs of SubarraysSolve
Boundary of Binary TreeSolve
Broken CalculatorSolve
Burst BalloonsSolve
Bus RoutesSolve
CandySolve
Car PoolingSolve
Cat and MouseSolve
Cheapest Flights Within K StopsSolve
Check Completeness of a Binary TreeSolve
Check if Object Instance of ClassSolve
Check if the Sentence Is PangramSolve
Cherry PickupSolve
Classes With at Least 5 StudentsSolve
Clone GraphSolve
Coin Change IISolve
Combination Sum IISolve
CombinationsSolve
Compare Version NumbersSolve
Concatenation of ArraySolve
Consecutive NumbersSolve
Consecutive Numbers SumSolve
Construct Binary Tree from Preorder and Inorder TraversalSolve
Contains Duplicate IISolve
Contains Duplicate IIISolve
Convert BST to Greater TreeSolve
Count Binary SubstringsSolve
Count Elements With Maximum FrequencySolve
Count Negative Numbers in a Sorted MatrixSolve
Count Number of Nice SubarraysSolve
Count Odd Numbers in an Interval RangeSolve
Count PrimesSolve
Count Servers that CommunicateSolve
Count Subarrays With Fixed BoundsSolve
Count Vowel Substrings of a StringSolve
CounterSolve
Counting BitsSolve
Create Hello World FunctionSolve
Customer Placing the Largest Number of OrdersSolve
Decode WaysSolve
Delete and EarnSolve
Delete Duplicate EmailsSolve
Delete Duplicate Folders in SystemSolve
Delete Node in a BSTSolve
Delete Nodes From Linked List Present in ArraySolve
Design a Text EditorSolve
Design Add and Search Words Data StructureSolve
Design Browser HistorySolve
Design Circular QueueSolve
Design Hit CounterSolve
Design In-Memory File SystemSolve
Design Linked ListSolve
Design Task ManagerSolve
Diameter of Binary TreeSolve
Distinct SubsequencesSolve
Employee BonusSolve
Encode and Decode StringsSolve
Evaluate DivisionSolve
Excel Sheet Column TitleSolve
Exclusive Time of FunctionsSolve
Factorial Trailing ZeroesSolve
Find All Numbers Disappeared in an ArraySolve
Find if Path Exists in GraphSolve
Find K Pairs with Smallest SumsSolve
Find Lucky Integer in an ArraySolve
Find N Unique Integers Sum up to ZeroSolve
Find Resultant Array After Removing AnagramsSolve
Find the K-th Character in String Game ISolve
Find the Maximum Achievable NumberSolve
Find the Maximum Length of Valid Subsequence ISolve
Find the Maximum Length of Valid Subsequence IISolve
Find the Minimum Area to Cover All Ones ISolve
Find the Minimum Area to Cover All Ones IISolve
Find The Original Array of Prefix XorSolve
Find X-Sum of All K-Long Subarrays ISolve
First Bad VersionSolve
Flatten a Multilevel Doubly Linked ListSolve
Flood FillSolve
Friend Requests II: Who Has the Most FriendsSolve
Fruit Into BasketsSolve
Fruits Into Baskets IISolve
Fruits Into Baskets IIISolve
Game of LifeSolve
Get the Maximum ScoreSolve
Greatest Common Divisor of StringsSolve
H-IndexSolve
Hand of StraightsSolve
House Robber IIISolve
Immediate Food Delivery IISolve
Implement Queue using StacksSolve
Implement RouterSolve
Insert Delete GetRandom O(1)Solve
Insert Delete GetRandom O(1) - Duplicates allowedSolve
Insert Greatest Common Divisors in Linked ListSolve
Insert IntervalSolve
Insert into a Binary Search TreeSolve
Integer to English WordsSolve
Interleaving StringSolve
Intersection of Two Arrays IISolve
Intersection of Two Linked ListsSolve
Interval List IntersectionsSolve
Investments in 2016Solve
IPOSolve
Is Graph Bipartite?Solve
Is SubsequenceSolve
Island PerimeterSolve
Isomorphic StringsSolve
Jewels and StonesSolve
Jump Game IIISolve
K-th Smallest in Lexicographical OrderSolve
Kth Missing Positive NumberSolve
Kth Smallest Product of Two Sorted ArraysSolve
Largest Odd Number in StringSolve
Length of Last WordSolve
LFU CacheSolve
Logger Rate LimiterSolve
Longest Happy PrefixSolve
Longest PalindromeSolve
Longest Palindrome by Concatenating Two Letter WordsSolve
Longest String ChainSolve
Longest Subarray of 1's After Deleting One ElementSolve
Longest Subarray With Maximum Bitwise ANDSolve
Longest Substring with At Least K Repeating CharactersSolve
Longest Substring with At Most K Distinct CharactersSolve
Lowest Common Ancestor of a Binary Search TreeSolve
Majority Element IISolve
Make Array Elements Equal to ZeroSolve
Managers with at Least 5 Direct ReportsSolve
Max Area of IslandSolve
Maximal Network RankSolve
Maximize Greatness of an ArraySolve
Maximize Subarrays After Removing One Conflicting PairSolve
Maximum 69 NumberSolve
Maximum Average Subarray ISolve
Maximum Difference Between Even and Odd Frequency IISolve
Maximum Erasure ValueSolve
Maximum Manhattan Distance After K ChangesSolve
Maximum Number of Non-overlapping Palindrome SubstringsSolve
Maximum Number of Words You Can TypeSolve
Maximum Palindromes After OperationsSolve
Maximum Points You Can Obtain from CardsSolve
Maximum Population YearSolve
Maximum Profit in Job SchedulingSolve
Maximum Subsequence ScoreSolve
Maximum Unique Subarray Sum After DeletionSolve
Maximum Width of Binary TreeSolve
Meeting RoomsSolve
Meeting Rooms IIISolve
Merge In Between Linked ListsSolve
Merge Strings AlternatelySolve
Min Cost to Connect All PointsSolve
Minimize Malware SpreadSolve
Minimize the Maximum Difference of PairsSolve
Minimum Genetic MutationSolve
Minimum Number of Increments on Subarrays to Form a Target ArraySolve
Minimum Number of Refueling StopsSolve
Minimum Penalty for a ShopSolve
Minimum Score Triangulation of PolygonSolve
Minimum Suffix FlipsSolve
Minimum Swaps to Make Strings EqualSolve
Minimum Window SubstringSolve
Missing NumberSolve
Monthly Transactions ISolve
Movie RatingSolve
N-Queens IISolve
Network Delay TimeSolve
New 21 GameSolve
Next Greater Element IISolve
Next Greater Element IIISolve
Nth Highest SalarySolve
Number of Digit OneSolve
Number of EnclavesSolve
Number of Good PairsSolve
Number of People Aware of a SecretSolve
Number of Substrings Containing All Three CharactersSolve
Number of Visible People in a QueueSolve
Number of Zero-Filled SubarraysSolve
Open the LockSolve
Optimal Account BalancingSolve
Palindrome Linked ListSolve
Palindrome Partitioning IISolve
Partition Array According to Given PivotSolve
Partition ListSolve
Path SumSolve
Path Sum IISolve
Permutation SequenceSolve
Plus OneSolve
Populating Next Right Pointers in Each Node IISolve
Power Grid MaintenanceSolve
Power of ThreeSolve
Primary Department for Each EmployeeSolve
Product Sales Analysis IIISolve
Range Sum Query - ImmutableSolve
Reach a NumberSolve
Rearrange Words in a SentenceSolve
Reconstruct ItinerarySolve
Rectangle OverlapSolve
Remove All Adjacent Duplicates In StringSolve
Remove Duplicates from Sorted Array IISolve
Remove Invalid ParenthesesSolve
Remove K DigitsSolve
Remove Linked List ElementsSolve
Reorder ListSolve
Reorder Routes to Make All Paths Lead to the City ZeroSolve
Reorganize StringSolve
Replace Employee ID With The Unique IdentifierSolve
Reverse BitsSolve
Reverse PairsSolve
Reverse StringSolve
Reverse Vowels of a StringSolve
Richest Customer WealthSolve
Robot Bounded In CircleSolve
Robot Room CleanerSolve
Search a 2D MatrixSolve
Search a 2D Matrix IISolve
Search Suggestions SystemSolve
Serialize and Deserialize BSTSolve
Set MismatchSolve
Shortest BridgeSolve
Shortest Common SupersequenceSolve
Shortest Path in Binary MatrixSolve
Single Number IISolve
Smallest Number With All Set BitsSolve
Snakes and LaddersSolve
Snapshot ArraySolve
Sort Characters By FrequencySolve
Sorting the SentenceSolve
Split Array With Same AverageSolve
Split Linked List in PartsSolve
SubsetsSolve
Successful Pairs of Spells and PotionsSolve
Sum of Beauty of All SubstringsSolve
Sum Root to Leaf NumbersSolve
Surrounded RegionsSolve
Swap Nodes in PairsSolve
Swapping Nodes in a Linked ListSolve
Text JustificationSolve
The Dining PhilosophersSolve
The Skyline ProblemSolve
The Two Sneaky Numbers of DigitvilleSolve
To Be Or Not To BeSolve
Top K Frequent WordsSolve
Transform Array to All Equal ElementsSolve
Trapping Rain Water IISolve
TriangleSolve
Twisted Mirror Path CountSolve
Unique Number of OccurrencesSolve
Unique PathsSolve
Valid Palindrome IISolve
Valid Parenthesis StringSolve
Valid Perfect SquareSolve
Valid Triangle NumberSolve
Vertical Order Traversal of a Binary TreeSolve
Water BottlesSolve
Word Break IISolve
Word Ladder IISolve
Zigzag ConversionSolve