Microsoft Hash Table Coding Interview Questions
70 hash table coding problems are tagged as asked at Microsoft in interviews and online assessments reported by candidates. By difficulty they split into 24 basic, 32 intermediate and 14 advanced. The topics they most often combine with are Array, String, Sorting, Tree.
Reported questions change over time and are not a guarantee of what you will be asked, so use the list to see which patterns Microsoft tends to test. For each problem, practise explaining your approach, its time and space cost and the edge cases before you write the code; every problem opens in an editor that runs your code against test cases.
Coding problems
- Contains Duplicate (Basic)
- Climbing Stairs (Basic)
- First Unique Character (Basic)
- Kth Largest Element (Intermediate)
- Missing Number (Basic)
- Intersection of Two Arrays (Basic)
- Valid Anagram (Basic)
- Third Maximum Number (Basic)
- Search in a Rotated Sorted Array (Advanced)
- Minimum in a Rotated Sorted Array (Intermediate)
- Sort Characters by Frequency (Intermediate)
- Kth Missing Positive Number (Basic)
- Minimum Deletions for Unique Frequencies (Intermediate)
- Unique Number of Occurrences (Basic)
- Count Unique Binary Search Trees (Basic)
- Count Numbers With Unique Digits (Intermediate)
- Tree Nodes at Distance K (Advanced)
- Coin Change Ways (Intermediate)
- BST Range Sum (Basic)
- Count Distinct Islands Shapes (Basic)
- Find Duplicate Subtrees (Basic)
- Kth Smallest Value in a BST (Intermediate)
- Lowest Common Ancestor of Two Values (Intermediate)
- Tree From Inorder and Postorder (Intermediate)
- Delete Node in a BST (Intermediate)
- Cousins in Binary Tree (Basic)
- Flip Equivalent Binary Trees (Intermediate)
- Alien Dictionary Order (Advanced)
- Loud and Rich (Intermediate)
- Combination Sum IV (Intermediate)
- Longest String Chain (Intermediate)
- Word Search II Count (Advanced)
- Custom Sort String (Basic)
- Minimum Steps to Make Two Strings Anagram (Basic)
- Remove Duplicate Letters (Advanced)
- Validate Stack Sequences (Intermediate)
- Number of Visible People in a Queue (Advanced)
- IPO (Advanced)
- Super Ugly Number (Intermediate)
- Find All Duplicates in an Array (Intermediate)
- 3Sum Triplets (Intermediate)
- Kth Smallest in a Sorted Matrix (Intermediate)
- Search in Rotated Sorted Array II (Intermediate)
- Combination Sum (Intermediate)
- Combination Sum II (Intermediate)
- Word Break II (Advanced)
- Max Length of Concatenated Unique Characters (Intermediate)
- Unique Paths III (Advanced)
- Design HashMap (Basic)
- Max Points on a Line (Advanced)
- Find the Difference of Two Arrays (Basic)
- Minimum Area Rectangle (Intermediate)
- Second Largest Digit in a String (Basic)
- Convert BST to Greater Tree (Intermediate)
- Balance a Binary Search Tree (Intermediate)
- Min Cost to Connect All Points (Intermediate)
- Unique Length-3 Palindromic Subsequences (Intermediate)
- Minimum Total Distance Traveled (Advanced)
- Most Common Word (Basic)
- Jewels and Stones (Basic)
- String Matching in an Array (Basic)
- Duplicate Zeros (Basic)
- Maximum Erasure Value (Intermediate)
- Minimum Operations to Make Array Continuous (Advanced)
- Remove All Adjacent Duplicates in String II (Intermediate)
- Maximum Frequency Stack (Advanced)
- Sort Array by Increasing Frequency (Basic)
- Remove Covered Intervals (Intermediate)
- Meeting Rooms III (Advanced)
- Bitwise ORs of Subarrays (Intermediate)
Related
- Microsoft coding interview questions
- Hash Table problems
- Microsoft basic problems
- Microsoft intermediate problems
- Microsoft advanced problems
- Company interview roadmaps
- All interview guides
Frequently asked questions
How should I use the Microsoft problem list?
Start with the basic problems, then the intermediate and advanced ones, and note which topics repeat. Solve each under a timer, then read the explanation.
Are these the exact Microsoft interview questions?
They are problems candidates reported being asked. Companies rotate questions, so use them to learn the patterns, not to predict the exact question.