Microsoft Interview Questions and Guide
Practical coding, clear communication, and design questions grounded in the team's product area.
The Microsoft interview loop
- Recruiter screen
- Technical screen
- Loop: 4 rounds of coding and design with an "as appropriate" final interviewer
Microsoft interview questions
- Design a URL Shortener
- Design WhatsApp
- Design a News Feed
- Design a Web Crawler
- Design Dropbox
- Design Google Docs
- Design a Distributed Cache
- Design Search Autocomplete
- Design a Chat LLM Serving Platform
- Design Slack
- Design Google Calendar
- Design LeetCode
- Design Zoom (Video Conferencing)
- Design Figma (Multiplayer Editing)
- Design GitHub
- Design Gmail
- Design Google News
- Design a Distributed File System
- Design a Crossword Puzzle Solver
- Design a Content Delivery Network (CDN)
- Design Pastebin
- Design ChatGPT Playground
- Longest Substring Without Repeating Characters
- 3Sum
- Maximum Subarray (Kadane's Algorithm)
- Sort Colors (Dutch National Flag)
- Find the Duplicate Number
- Find All Anagrams in a String
- Longest Palindromic Substring
- Find the First Occurrence (KMP)
- Best Time to Buy and Sell Stock
- Valid Palindrome
- Valid Palindrome II
- Merge Sorted Array
- Move Zeroes
- Longest Common Prefix
- Rotate Image
- Spiral Matrix
- Next Permutation
- Set Matrix Zeroes
- Longest Repeating Character Replacement
- Max Consecutive Ones III
- Minimum Size Subarray Sum
- First Missing Positive
- Remove Duplicates from Sorted Array
- Rotate Array
- Two Sum II - Input Array Is Sorted
- Zigzag Conversion
- 4Sum
- 3Sum Closest
- Permutation in String
- String Compression
- Reverse Words in a String
- Game of Life
- Majority Element II
- Remove Element
- Merge Strings Alternately
- Maximum Average Subarray I
- Reverse Vowels of a String
- Maximum Product of Three Numbers
- Remove Duplicates from Sorted Array II
- Diagonal Traverse
- Spiral Matrix II
- Increasing Triplet Subsequence
- Frequency of the Most Frequent Element
- Maximum Points You Can Obtain from Cards
- Number of Substrings Containing All Three Characters
- Substring with Concatenation of All Words
- Rotate String
- Longest Substring with At Least K Repeating Characters
- Reverse Pairs
- Find Pivot Index
- Rearrange Array Elements by Sign
- Count Binary Substrings
- Can Make Arithmetic Progression From Sequence
- Find Missing and Repeated Values
- Find All Numbers Disappeared in an Array
- Valid Triangle Number
- Maximum Sum of Distinct Subarrays With Length K
- Maximum Number of Vowels in a Substring of Given Length
- Shortest Unsorted Continuous Subarray
- Longest Substring with At Most K Distinct Characters
- Longest Mountain in Array
- Sort an Array
- Range Sum Query - Immutable
- Range Sum Query 2D - Immutable
- Product of the Last K Numbers
- Implement an LRU Cache
- Two Sum
- Contains Nearby Duplicate
- First Unique Character
- Valid Anagram
- Isomorphic Strings
- Valid Sudoku
- Continuous Subarray Sum
- Subarray Sums Divisible by K
- Happy Number
- Logger Rate Limiter
- Contains Duplicate
- Ransom Note
- Word Pattern
- Design HashMap
- Binary Subarrays With Sum
- LFU Cache
- Design Underground System
- Find All Duplicates in an Array
- Longest Palindrome
- Invalid Transactions
- Unique Number of Occurrences
- Subarrays with K Different Integers
- K-diff Pairs in an Array
- Max Number of K-Sum Pairs
- Jewels and Stones
- Find Common Characters
- Shortest Word Distance II
- Sort Array by Increasing Frequency
- Reverse a Linked List
- Reverse a Sublist
- Detect a Cycle (Floyd's Algorithm)
- Find the Cycle Entry
- Middle of a Linked List
- Merge Two Sorted Lists
- Merge K Sorted Lists
- Remove the Nth Node From the End
- Reorder List
- Palindrome Linked List
- Add Two Numbers
- Swap Nodes in Pairs
- Rotate List
- Odd Even Linked List
- Remove Duplicates from Sorted List II
- Sort List
- Reverse Nodes in k-Group
- Remove Duplicates from Sorted List
- Remove Linked List Elements
- Partition List
- Delete the Middle Node of a Linked List
- Add Two Numbers II
- Insertion Sort List
- Next Greater Node In Linked List
- Swapping Nodes in a Linked List
- Maximum Twin Sum of a Linked List
- Design Linked List
- Merge Nodes in Between Zeros
- Merge In Between Linked Lists
- Remove Zero Sum Consecutive Nodes from Linked List
- Reverse Nodes in Even Length Groups
- Linked List Components
- Valid Parentheses
- Min Stack
- Basic Calculator II
- Largest Rectangle in Histogram
- Remove K Digits
- Minimum Remove to Make Valid Parentheses
- Asteroid Collision
- Simplify Path
- Basic Calculator
- Longest Valid Parentheses
- Sum of Subarray Minimums
- Next Greater Element I
- Final Prices With a Special Discount in a Shop
- Implement Queue using Stacks
- Minimum Add to Make Parentheses Valid
- 132 Pattern
- Remove Duplicate Letters
- Maximal Rectangle
- Car Fleet
- Backspace String Compare
- Baseball Game
- Basic Calculator III
- Sum of Subarray Ranges
- Maximum Width Ramp
- Remove Outermost Parentheses
- Design a Stack With Increment Operation
- Score of Parentheses
- Using a Robot to Print the Lexicographically Smallest String
- Sliding Window Maximum
- Rotting Oranges (Multi-source BFS)
- Binary Tree Level Order Traversal
- Design Circular Queue
- Shortest Path in Binary Matrix
- Implement Stack using Queues
- Find the Winner of the Circular Game
- Number of Students Unable to Eat Lunch
- Time Needed to Buy Tickets
- Dota2 Senate
- Snakes and Ladders
- Shortest Distance from All Buildings
- Minimum Genetic Mutation
- Find the Safest Path in a Grid
- Continuous Subarrays
- Count Subarrays With Fixed Bounds
- Kth Largest Element in an Array
- Task Scheduler
- Single-Threaded CPU Scheduling
- Top K Frequent Words
- Sort Characters by Frequency
- Kth Smallest Element in a Sorted Matrix
- Maximum Number of Events That Can Be Attended
- Meeting Rooms III
- Smallest Range Covering Elements from K Lists
- Design Twitter
- Seat Reservation Manager
- Total Cost to Hire K Workers
- Process Tasks Using Servers
- Find K Pairs with Smallest Sums
- Ugly Number II
- Minimum Cost to Hire K Workers
- Maximum Performance of a Team
- K-th Smallest Prime Fraction
- Stock Price Fluctuation
- Design Task Manager
- Find Score of an Array After Marking All Elements
- Maximal Score After Applying K Operations
- Search in Rotated Sorted Array
- Binary Search
- Find Minimum in Rotated Sorted Array
- Find a Peak Element
- Median of Two Sorted Arrays
- Search a 2D Matrix
- Sqrt(x)
- Single Element in a Sorted Array
- Search a 2D Matrix II
- Search in Rotated Sorted Array II
- Find the Smallest Divisor Given a Threshold
- Magnetic Force Between Two Balls
- H-Index II
- Heaters
- Arranging Coins
- Maximum Candies Allocated to K Children
- Kth Smallest Number in Multiplication Table
- Find K-th Smallest Pair Distance
- Find Smallest Letter Greater Than Target
- Count Negative Numbers in a Sorted Matrix
- Successful Pairs of Spells and Potions
- Minimum Time to Complete Trips
- Minimized Maximum of Products Distributed to Any Store
- Minimum Speed to Arrive on Time
- Lowest Common Ancestor of a Binary Tree
- Maximum Depth of a Binary Tree
- Balanced Binary Tree
- Binary Tree Maximum Path Sum
- Construct a Tree From Preorder and Inorder
- Binary Tree Inorder Traversal (Iterative)
- Same Tree
- Symmetric Tree
- Subtree of Another Tree
- Binary Tree Zigzag Level Order Traversal
- All Nodes Distance K in Binary Tree
- Path Sum III
- Maximum Width of Binary Tree
- Flatten Binary Tree to Linked List
- Amount of Time for Binary Tree to Be Infected
- Boundary of Binary Tree
- Vertical Order Traversal of a Binary Tree
- Count Good Nodes in Binary Tree
- Binary Tree Cameras
- Binary Tree Paths
- Minimum Depth of Binary Tree
- Path Sum
- Count Complete Tree Nodes
- Cousins in Binary Tree
- Maximum Difference Between Node and Ancestor
- Longest ZigZag Path in a Binary Tree
- Binary Tree Preorder Traversal
- Merge Two Binary Trees
- Check Completeness of a Binary Tree
- Construct Binary Tree from Inorder and Postorder Traversal
- Maximum Level Sum of a Binary Tree
- Search in a Binary Search Tree
- Validate a Binary Search Tree
- Lowest Common Ancestor in a BST
- Insert Into a Binary Search Tree
- Delete a Node in a BST
- Convert a Sorted Array to a Balanced BST
- Two Sum IV - Input is a BST
- Closest Binary Search Tree Value
- Inorder Successor in BST
- Recover Binary Search Tree
- Convert Sorted List to Binary Search Tree
- Convert BST to Greater Tree
- Minimum Absolute Difference in BST
- Balance a Binary Search Tree
- Unique Binary Search Trees
- Construct Binary Search Tree from Preorder Traversal
- Find Mode in Binary Search Tree
- All Elements in Two Binary Search Trees
- Largest BST Subtree
- Count of Smaller Numbers After Self
- Maximum Sum BST in Binary Tree
- Closest Nodes Queries in a Binary Search Tree
- Contains Duplicate III
- Number of Islands
- Min Cost to Connect All Points (MST)
- Max Area of Island
- Flood Fill
- Surrounded Regions
- Number of Connected Components in an Undirected Graph
- Making A Large Island
- Find Eventual Safe States
- Parallel Courses III
- Minimum Height Trees
- Find if Path Exists in Graph
- Number of Distinct Islands
- Critical Connections in a Network
- Reorder Routes to Make All Paths Lead to the City Zero
- Detonate the Maximum Bombs
- Find All Possible Recipes from Given Supplies
- Minimum Fuel Cost to Report to the Capital
- Detect Cycles in 2D Grid
- Find the Town Judge
- Minimize Malware Spread
- Count Unreachable Pairs of Nodes in an Undirected Graph
- Longest Increasing Subsequence
- House Robber
- Decode Ways
- Longest Common Subsequence
- 0/1 Knapsack
- Matrix Chain Multiplication
- Burst Balloons
- Palindrome Partitioning II (Min Cuts)
- Maximum Product Subarray
- Palindromic Substrings
- House Robber II
- Unique Paths II
- Maximal Square
- Interleaving String
- Regular Expression Matching
- Maximum Profit in Job Scheduling
- Longest Increasing Path in a Matrix
- Min Cost Climbing Stairs
- Pascal's Triangle
- Triangle
- Perfect Squares
- Minimum Cost For Tickets
- Predict the Winner
- Maximum Sum Circular Subarray
- Wildcard Matching
- Distinct Subsequences
- Russian Doll Envelopes
- Minimum Falling Path Sum
- Dungeon Game
- Delete and Earn
- Integer Break
- Minimum Difficulty of a Job Schedule
- Minimum Cost to Cut a Stick
- Fibonacci Number
- Count Square Submatrices with All Ones
- Cherry Pickup
- Longest String Chain
- Number of Ways to Form a Target String Given a Dictionary
- Painting the Walls
- New 21 Game
- Stone Game III
- Maximum Sum of 3 Non-Overlapping Subarrays
- Generate Subsets and Permutations
- Permutations
- N-Queens
- Sudoku Solver
- Word Search
- Subsets II
- Combination Sum II
- Permutations II
- Palindrome Partitioning
- Restore IP Addresses
- Word Break II
- Subsets
- Combination Sum III
- Letter Case Permutation
- Matchsticks to Square
- Word Ladder II
- 24 Game
- Beautiful Arrangement
- Path with Maximum Gold
- Maximum Length of a Concatenated String with Unique Characters
- Unique Paths III
- N-Queens II
- Different Ways to Add Parentheses
- The k-th Lexicographical String of All Happy Strings of Length n
- Jump Game
- Jump Game II (Minimum Jumps)
- Fractional Knapsack
- Activity Selection (Max Meetings in One Room)
- Best Time to Buy and Sell Stock II
- Can Place Flowers
- Valid Parenthesis String
- Largest Number
- Hand of Straights
- Lemonade Change
- Queue Reconstruction by Height
- Minimum Deletions to Make Character Frequencies Unique
- Reduce Array Size to The Half
- Wiggle Subsequence
- Bag of Tokens
- Minimum Number of Taps to Open to Water a Garden
- Broken Calculator
- Minimum Initial Energy to Finish Tasks
- Minimum Number of Increments on Subarrays to Form a Target Array
- Move Pieces to Obtain a String
- Partitioning Into Minimum Number Of Deci-Binary Numbers
- Minimum Arrows to Burst Balloons
- Summary Ranges
- Remove Covered Intervals
- My Calendar II
- My Calendar III
- Video Stitching
- Count Days Without Meetings
- Range Module
- Divide Intervals Into Minimum Number of Groups
- Find Right Interval
- Minimum Time Difference
- The Skyline Problem
- Points That Intersect With Cars
- Word Search II
- Implement a Trie (Prefix Tree)
- Maximum XOR of Two Numbers
- Longest Word in Dictionary
- Design Search Autocomplete System
- Implement Magic Dictionary
- Lexicographical Numbers
- Remove Sub-Folders from the Filesystem
- Words Within Two Edits of Dictionary
- Count Prefix and Suffix Pairs
- Number of 1 Bits (Brian Kernighan)
- Missing Number
- Sum of Two Integers Without + or -
- Add Binary
- Single Number II
- Single Number III
- Bitwise AND of Numbers Range
- Find the Difference
- Minimum Flips to Make a OR b Equal to c
- Gray Code
- Maximum Product of Word Lengths
- Divide Two Integers
- Reverse Bits
- Number Complement
- Binary Watch
- Minimum Operations to Reduce an Integer to 0
- Minimum Bit Flips to Convert Number
- Concatenation of Consecutive Binary Numbers
- Binary Gap
- Find Kth Bit in Nth Binary String
- XOR Queries of a Subarray
- Number of Steps to Reduce a Number to Zero
- Find The Original Array of Prefix Xor
- Prime Check
- Count Primes (Sieve of Eratosthenes)
- Greatest Common Divisor of Strings
- Permutation Sequence (k-th Permutation)
- Palindrome Number
- Reverse Integer
- Roman to Integer
- Integer to Roman
- String to Integer (atoi)
- Multiply Strings
- Excel Sheet Column Title
- Fraction to Recurring Decimal
- Integer to English Words
- Angle Between Hands of a Clock
- Plus One
- Add Strings
- Fizz Buzz
- Count and Say
- Bulb Switcher
- Max Points on a Line
- Robot Bounded In Circle
- Power of Three
- Ugly Number
- Add Digits
- Perfect Number
- Count Good Numbers
- Number of Digit One
- Compare Version Numbers
- Excel Sheet Column Number
- Nth Digit
- Factorial Trailing Zeroes
- Water and Jug Problem
- Nim Game
- The kth Factor of n
- Count Numbers with Unique Digits
- Rectangle Area
- Base 7
- Find the Closest Palindrome
- Design a Parking Lot
- Design a Vending Machine
- Design Snakes and Ladders
- Design Connect Four
- Design a Chess Game
- Design a Deck of Cards for Blackjack
- Design Tic-Tac-Toe
- Design Splitwise
- Design an ATM
- Design a Library Management System
- Design a Meeting Room Scheduler
- Design a Movie Ticket Booking System
- Design a Q&A Site like Stack Overflow
- Design a Text Editor with Undo and Redo
- Design a Spreadsheet with Formulas
- Design a Logging Framework
- Design an In-Memory Pub/Sub Message Broker
- Design a Task Scheduler
- Design a File Search Tool (Unix find)
- Design a Cache with Pluggable Eviction
- Design a Bounded Blocking Queue
- Design an In-Memory File System
- Tell me about yourself
- Tell me about a time you worked with ambiguity
- Tell me about a time you helped someone grow
- Why are you leaving your current role?
- What are you looking for in your next team?
- Where do you see yourself in five years?
- Tell me about working with a difficult stakeholder
- Tell me about a time you had to compromise
- Tell me about delivering a project across multiple teams
- Tell me about a time you led without formal authority
- Tell me about a time you improved how your team works
- Tell me about working with an underperforming teammate
- How do you prioritize competing demands?
- Tell me about a mistake that affected others
- What is a weakness you're working on?
- Tell me about the hardest bug you've debugged
- Tell me about a time you made the case for paying down tech debt
- Tell me about a time you had to earn the trust of a skeptical team
- Tell me about raising the bar when hiring or developing people
- Your team is split on a technical direction. What do you do?
- Tell me about a time you made sure every voice on your team was heard
- Tell me about a time you changed your mind
- Refactor a Legacy Module with AI
- Review an AI-Generated Pull Request
- Fix a Concurrency Bug with AI