The problems every company asks
165 problems that appear at 4 or more major companies. If you do not yet know where you are interviewing, start here — these are the ones that pay off wherever you end up.
Ordered foundational first within each difficulty, not by how hard they feel.
easy37 problems
- 1.Two Sum
- 2.Best Time to Buy and Sell Stock
- 3.Reverse Linked List
- 4.Valid Parentheses
- 5.Sqrt(x)
- 6.Palindrome Linked List
- 7.Valid Anagram
- 8.Reverse Words in a String
- 9.Longest Common Prefix
- 10.String Compression
- 11.Roman to Integer
- 12.Implement strStr()
- 13.Is Subsequence
- 14.First Unique Character in a String
- 15.Move Zeroes
- 16.Word Pattern
- 17.Move Zeroes
- 18.Word Pattern
- 19.Remove Duplicates from Sorted Array
- 20.Isomorphic Strings
- 21.Remove Duplicates from Sorted Array
- 22.Isomorphic Strings
- 23.Missing Number
- 24.Intersection of Two Linked Lists
- 25.Missing Number
- 26.Intersection of Two Linked Lists
- 27.Majority Element
- 28.Missing Number
- 29.Majority Element
- 30.Missing Number
- 31.Longest Palindrome
- 32.Longest Palindrome
- 33.Longest Palindrome
- 34.Flood Fill
- 35.Flood Fill
- 36.Flood Fill
- 37.Flood Fill
medium91 problems
- 1.Maximum Subarray
- 2.Product of Array Except Self
- 3.3Sum
- 4.Container With Most Water
- 5.Merge Intervals
- 6.Spiral Matrix
- 7.Search in Rotated Sorted Array
- 8.Longest Substring Without Repeating Characters
- 9.Longest Palindromic Substring
- 10.LRU Cache
- 11.Binary Tree Level Order Traversal
- 12.Validate Binary Search Tree
- 13.Number of Islands
- 14.Course Schedule
- 15.Coin Change
- 16.Longest Increasing Subsequence
- 17.Word Break
- 18.Generate Parentheses
- 19.Kth Largest Element in an Array
- 20.Top K Frequent Elements
- 21.Implement Trie (Prefix Tree)
- 22.Find First and Last Position in Sorted Array
- 23.Course Schedule II
- 24.Cheapest Flights Within K Stops
- 25.Max Area of Island
- 26.Remove Nth Node From End of List
- 27.Sort List
- 28.Copy List with Random Pointer
- 29.Decode String
- 30.Group Anagrams
- 31.Count and Say
- 32.Zigzag Conversion
- 33.K Closest Points to Origin
- 34.Implement Trie (Prefix Tree)
- 35.Detect Cycle in Directed Graph
- 36.Detect Cycle in Directed Graph
- 37.Basic Calculator II
- 38.Largest Number
- 39.Topological Sort (Classic)
- 40.Largest Number
- 41.Basic Calculator II
- 42.Topological Sort (Classic)
- 43.Add Two Numbers
- 44.Multiply Strings
- 45.Multiply Strings
- 46.Add Two Numbers
- 47.Sort Colors
- 48.Construct Binary Tree from Preorder and Inorder Traversal
- 49.String to Integer (atoi)
- 50.Sort Colors
- 51.String to Integer (atoi)
- 52.Construct Binary Tree from Preorder and Inorder Traversal
- 53.Next Permutation
- 54.Linked List Cycle II
- 55.Kth Smallest Element in a Sorted Matrix
- 56.Valid Parenthesis String
- 57.Valid Parenthesis String
- 58.Kth Smallest Element in a Sorted Matrix
- 59.Next Permutation
- 60.Valid Parenthesis String
- 61.Linked List Cycle II
- 62.Kth Smallest Element in a Sorted Matrix
- 63.Longest Consecutive Sequence
- 64.Longest Consecutive Sequence
- 65.Number of Ways to Arrive at Destination
- 66.Longest Consecutive Sequence
- 67.Search in Rotated Sorted Array II
- 68.Number of Ways to Arrive at Destination
- 69.Set Matrix Zeroes
- 70.Lowest Common Ancestor of a Binary Tree
- 71.Set Matrix Zeroes
- 72.Lowest Common Ancestor of a Binary Tree
- 73.Set Matrix Zeroes
- 74.Lowest Common Ancestor of a Binary Tree
- 75.Insert Interval
- 76.Insert Interval
- 77.Insert Interval
- 78.Insert Interval
- 79.Search a 2D Matrix II
- 80.Non-overlapping Intervals
- 81.Non-overlapping Intervals
- 82.Non-overlapping Intervals
- 83.Non-overlapping Intervals
- 84.Gas Station
- 85.Gas Station
- 86.Gas Station
- 87.Gas Station
- 88.Simplify Path
- 89.Construct Binary Tree from Inorder and Postorder
- 90.Coin Change II
- 91.Shortest Unsorted Continuous Subarray
hard37 problems
- 1.Trapping Rain Water
- 2.Minimum Window Substring
- 3.Median of Two Sorted Arrays
- 4.Merge K Sorted Lists
- 5.Edit Distance
- 6.Largest Rectangle in Histogram
- 7.Reverse Nodes in k-Group
- 8.Alien Dictionary
- 9.Alien Dictionary
- 10.Serialize and Deserialize Binary Tree
- 11.Binary Tree Maximum Path Sum
- 12.Reconstruct Itinerary
- 13.Reconstruct Itinerary
- 14.Sudoku Solver
- 15.Sudoku Solver
- 16.Word Ladder II
- 17.Word Ladder II
- 18.Regular Expression Matching
- 19.Regular Expression Matching
- 20.Regular Expression Matching
- 21.Largest Rectangle in Binary Matrix
- 22.Largest Rectangle in Binary Matrix
- 23.Largest Rectangle in Binary Matrix
- 24.Largest Rectangle in Binary Matrix
- 25.Word Break II
- 26.Word Break II
- 27.Word Break II
- 28.Split Array Largest Sum
- 29.Alien Dictionary
- 30.Alien Dictionary
- 31.Alien Dictionary
- 32.Median of Two Sorted Arrays
- 33.Alien Dictionary
- 34.First Missing Positive
- 35.First Missing Positive
- 36.First Missing Positive
- 37.First Missing Positive
Where to go from here
Working through these covers most of what a generalist interview draws on. Once you know which company you are interviewing at, its page lists what that company specifically asks — and the full bank has every problem grouped by pattern.
Company tags come from reported interview questions and are a guide, not a guarantee.