Microsoft Prep — Coding Problem List
Category Problem LeetCode Link
Two Sum Two Sum (LeetCode)
3Sum 3Sum
3Sum Closest 3Sum Closest
4Sum 4Sum
Remove Duplicates from Sorted Array Remove Duplicates from Sorted Array
Remove Element Remove Element
Search Insert Position Search Insert Position
Find First and Last Position of Element in Find First and Last Position of Element in
Array & Sorted Array Sorted Array
Matrix Next Permutation Next Permutation
Maximum Subarray Maximum Subarray
Rotate Image Rotate Image
Sort Colors Sort Colors
Spiral Matrix / II Spiral Matrix / Spiral Matrix II
Search a 2D Matrix Search a 2D Matrix
Remove Duplicates from Sorted Array II Remove Duplicates from Sorted Array II
Jump Game / II Jump Game / Jump Game II
Trapping Rain Water Trapping Rain Water
Longest Substring Without Repeating Longest Substring Without Repeating
Characters Characters
Longest Palindromic Substring Longest Palindromic Substring
Zigzag Conversion ZigZag Conversion
Integer to Roman / Roman to Integer Integer to Roman / Roman to Integer
String to Integer (atoi) String to Integer (atoi)
Longest Common Prefix Longest Common Prefix
Palindrome Number Palindrome Number
String
Regular Expression Matching Regular Expression Matching
Wildcard Matching Wildcard Matching
Valid Palindrome Valid Palindrome
Implement strStr() / Find the Index of the
Implement strStr()
First Occurrence in a String
Text Justification Text Justification
Decode Ways Decode Ways
Letter Combinations of a Phone Number Letter Combinations of a Phone Number
Valid Parentheses Valid Parentheses
Generate Parentheses Generate Parentheses
Stack / Longest Valid Parentheses Longest Valid Parentheses
Parentheses Remove Invalid Parentheses Remove Invalid Parentheses
Min Stack Min Stack
Largest Rectangle in Histogram Largest Rectangle in Histogram
Linked List Merge Two Sorted Lists Merge Two Sorted Lists
Category Problem LeetCode Link
Merge k Sorted Lists Merge k Sorted Lists
Swap Nodes in Pairs Swap Nodes in Pairs
Reverse Nodes in k-Group Reverse Nodes in k-Group
Remove Nth Node From End of List Remove Nth Node From End of List
Linked List Cycle / Cycle II Linked List Cycle / Linked List Cycle II
Reorder List Reorder List
Reverse Linked List Reverse Linked List
Add Two Numbers Add Two Numbers
LRU Cache LRU Cache
Sort List Sort List
Maximum Depth of Binary Tree Maximum Depth of Binary Tree
Construct Binary Tree from Preorder and
Construct BT from Preorder & Inorder
Inorder Traversal
Construct Binary Tree from Inorder and
Construct BT from Inorder & Postorder
Postorder Traversal
Convert Sorted Array to BST Convert Sorted Array to BST
Convert Sorted List to BST Convert Sorted List to BST
Validate BST Validate Binary Search Tree
Tree / BST Recover BST Recover Binary Search Tree
Path Sum / Path Sum II Path Sum / Path Sum II
Flatten Binary Tree to Linked List Flatten Binary Tree to Linked List
Populating Next Right Pointers Populating Next Right Pointers in Each Node
Unique Binary Search Trees / Unique Binary
Unique BST / II
Search Trees II
(Inorder, Preorder, Postorder, Level Order) —
Tree Traversals
use standard traversal implementations
Serialize & Deserialize BT/BST Serialize and Deserialize Binary Tree
Binary Tree Maximum Path Sum Binary Tree Maximum Path Sum
Find Median from Data Stream Find Median from Data Stream
Heap / Kth Largest Element in Array / Stream Kth Largest Element in an Array
Priority Top K Frequent Elements Top K Frequent Elements
Queue Merge k Sorted Lists (already listed above under Linked List)
Trapping Rain Water (already listed above under Array)
Group Anagrams Group Anagrams
Valid Anagram Valid Anagram
Intersection of Two Arrays / II Intersection of Two Arrays II
Subarray Sum Equals K Subarray Sum Equals K
Hash Table
Isomorphic Strings Isomorphic Strings
Count Primes Count Primes
Contains Duplicate / Contains Duplicate II /
Contains Duplicate / II / III
Contains Duplicate III
Edit Distance Edit Distance
Category Problem LeetCode Link
Unique Paths / II Unique Paths / Unique Paths II
Climbing Stairs Climbing Stairs
Minimum Path Sum Minimum Path Sum
Maximum Subarray (already in Array)
Decode Ways (already in String)
Word Break / II Word Break / Word Break II
Dynamic Interleaving String Interleaving String
Programming Longest Increasing Subsequence Longest Increasing Subsequence
Partition Equal Subset Sum Partition Equal Subset Sum
Palindromic Substrings Palindromic Substrings
Triangle Triangle
Dungeon Game Dungeon Game
Perfect Squares Perfect Squares
Coin Change / II Coin Change / Coin Change II
Word Ladder / II Word Ladder / Word Ladder II
Clone Graph Clone Graph
Course Schedule / II Course Schedule / Course Schedule II
Number of Islands Number of Islands
Graph / BFS /
Surrounded Regions Surrounded Regions
DFS
Minimum Height Trees Minimum Height Trees
Network Delay Time Network Delay Time
Pacific Atlantic Water Flow Pacific Atlantic Water Flow
Graph Valid Tree Graph Valid Tree
Pow(x, n) Pow(x, n)
Sqrt(x) Sqrt(x)
Excel Sheet Column Number / Excel Sheet
Excel Sheet Column Number / Title
Column Title
Math & Bit Factorial Trailing Zeroes Factorial Trailing Zeroes
Manipulation Majority Element Majority Element
Missing Number Missing Number
Hamming Distance Hamming Distance
Rotate Function Rotate Function
Random Pick with Weight Random Pick with Weight
Sudoku Solver Sudoku Solver
Valid Sudoku Valid Sudoku
Design Add and Search Words Data
Add and Search Word - Data structure design
Others / Structure (Trie)
Miscellaneous LFU Cache LFU Cache
Design HashMap Design HashMap
Basic Calculator / Basic Calculator II / Basic
Basic Calculator / II / III
Calculator III