Microsoft Coding Interview Questions and Top Patterns
Microsoft asks classics, and it asks them often. The tagged list reads like a greatest hits album of interview problems, with Two Sum, Add Two Numbers, and LRU-style standards at the top. The one surprise is dynamic programming, which carries a heavier share here than at Google, Meta, or Amazon.
This page ranks the questions that appear most often in Microsoft’s tagged problem data. Every row links to the pattern guide on this site that teaches the technique. The sections after the table turn the numbers into a study order.
The short version
- About half the tagged problems rank as Medium. About one third rank as Easy.
- Dynamic programming appears in about one problem in five. That share is the highest on this site.
- The bank repeats known problems. Speed and clean templates count here.
Microsoft’s Interview Loop
- An online assessment opens the process for many candidates. It usually holds two or three coding tasks.
- One or two phone screens follow with live coding in a shared editor.
- The final loop runs about four rounds in one day, often virtual.
- Most rounds are coding. Senior roles add a design round.
- A behavioral round closes the day. Microsoft screens for collaboration and a growth mindset. Expect questions about past teamwork and feedback.
- Interviewers often pick from well-known tagged problems rather than novel ones.
That last bullet is your edge. When a company recycles known problems, preparation compounds. A candidate who has practiced this exact list walks in ahead of one who spent the same hours on random puzzles.
The Questions Microsoft Asks Most
LeetCode tags problems by company from candidate reports and scores each tag on a relative frequency scale from 0 to 100. These 20 score highest across a recent tagging window for Microsoft. Each row links to our guide for that technique.
If you learn five guides first, learn these
- Start with two pointers . It covers five rows of the table by itself.
- Pair it with sliding window for the substring rows.
- Add hash table for Two Sum and the anagram rows.
- Learn Kadane’s algorithm for the subarray rows.
- Cover linked list early. Add Two Numbers sits near the top of the list.
| Problem | Difficulty | Demand | Pattern Guide |
|---|---|---|---|
| Two Sum | Easy | Very high | Hash Table |
| Longest Palindromic Substring | Medium | Very high | Two Pointers |
| Add Two Numbers | Medium | Very high | Linked List |
| Maximum Subarray | Medium | Very high | Kadane’s Algorithm |
| Longest Substring Without Repeating Characters | Medium | High | Sliding Window |
| Container With Most Water | Medium | High | Two Pointers |
| 3Sum | Medium | High | Two Pointers |
| Remove Duplicates from Sorted Array | Easy | High | Two Pointers |
| Merge Intervals | Medium | High | Interval Scheduling |
| Next Permutation | Medium | High | Array Manipulation |
| Best Time to Buy and Sell Stock | Easy | High | Kadane’s Algorithm |
| Longest Consecutive Sequence | Medium | High | Hash Table |
| Maximum Average Subarray I | Easy | High | Sliding Window |
| Roman to Integer | Easy | High | Hash Table |
| Valid Parentheses | Easy | High | Stack |
| Trapping Rain Water | Hard | High | Two Pointers |
| Number of Islands | Medium | High | Graph Traversal |
| Search a 2D Matrix | Medium | High | Binary Search |
| Median of Two Sorted Arrays | Hard | High | Binary Search |
| Valid Anagram | Easy | High | Hash Table |
Notice how many entries are two pointers and sliding window variants. Longest Palindromic Substring, Container With Most Water, 3Sum, Remove Duplicates, and Trapping Rain Water all run on the same core mechanics with different rules for which pointer moves. Master that family once and five rows of this table collapse into one skill.
Topics and Difficulty at Microsoft
The most common topics among tagged Microsoft problems appear below. The share is the percent of tagged problems carrying the topic, and topics overlap, so shares add past 100 percent.
| Topic | Tagged Problems | Share |
|---|---|---|
| Array Manipulation | 107 | ~54% |
| Dynamic Programming | 43 | ~22% |
| Hash Table | 42 | ~21% |
| String Manipulation | 42 | ~21% |
| Math Algorithms | 29 | ~15% |
| Two Pointers | 25 | ~13% |
| Sorting | 24 | ~12% |
| Binary Search | 19 | ~10% |
| Graph Traversal (DFS and BFS) | 32 | ~16% combined |
| Greedy Algorithms | 16 | ~8% |
Sorting carries no link because we treat it as part of other patterns rather than a pattern of its own. The row to respect is dynamic programming at 22 percent. That is the heaviest DP share of any company page on this site, above Google’s 17 percent and Meta’s 14 percent. Microsoft expects you to recognize subproblem structure, not just sort and scan.
Difficulty splits close to the big-tech average:
| Difficulty | Problems | Share |
|---|---|---|
Easy | 65 | 33% |
Medium | 104 | 52% |
Hard | 30 | 15% |
One third Easy, half Medium, one sixth Hard. The distribution says Microsoft filters on clean fundamentals more than on exotic difficulty, which matches the classic-heavy list above.
Method: LeetCode company-tagged problem lists with relative frequency scores from 0 to 100. Shares overlap because one problem can carry several topics.
Where to Spend Your Prep Time
- Learn the two pointers and sliding window family first. It covers more top-20 rows than any other technique. Work the two pointers and sliding window guides back to back.
- Learn basic dynamic programming properly. Maximum Subarray and Best Time to Buy and Sell Stock both rank here, and the topic share backs them up. Start with the dynamic programming guide, then Kadane’s algorithm for the subarray case.
- Cover linked lists early. Add Two Numbers sits near the very top, and Microsoft keeps linked list questions in rotation year after year. The linked list guide is short and pays off fast.
- Practice writing classics from a blank file. Since the bank skews famous, speed matters. Time yourself on Two Sum and Valid Parentheses until each takes under ten minutes including tests.
- Review on a schedule instead of rereading. Spaced repetition returns each pattern right before you would forget it, which is exactly what a recycled-question bank rewards.
graph TD
A["Two pointers and sliding window"] --> B["Hash table"]
B --> C["Kadane's algorithm and dynamic programming"]
C --> D["Linked list and stack basics"]
D --> E["Timed classics from a blank file"]
E --> F["Spaced repetition until interview day"]
The diagram follows the prep plan from the widest coverage down to timed practice.
Questions Candidates Ask
Does Microsoft reuse LeetCode problems?
Often it does. The tagged list reads like a classics collection. Interviewers pick from known problems more than novel ones, which is why speed on famous questions matters here.
How much dynamic programming is enough?
More than at peer companies. DP appears in about one tagged problem in five, the highest share on this site. Learn the standard subarray cases first, then work the dynamic programming guide.
Should beginners still apply with so many Mediums?
Yes. One third of tagged problems rank Easy, and early rounds often open with one. A fast clean Easy solution counts. Then Mediums decide the day.
What should I study first?
The two pointers and sliding window family. It covers five rows of the top-20 table by itself. Pair it with hash table next.
Next Steps
Work down the table and open any guide whose template you cannot write cold. The coding patterns index lists every guide, and two pointers plus dynamic programming give you the biggest head start on this list. For comparison, see how DP weight drops in the Meta guide and how design weight rises in the Apple one.