IBM LeetCode Questions
100 questions all-time · 26 easy · 65 medium · 9 hard
| # | Problem | Difficulty | Frequency | Acceptance |
|---|---|---|---|---|
| 1 | Exclusive Time of Functions Array, Stack | Medium | 100 | 64.8% |
| 2 | Integer to Roman Hash Table, Math, String | Medium | 93 | 68.6% |
| 3 | Fizz Buzz Math, String, Simulation | Easy | 90 | 74.4% |
| 4 | Roman to Integer Hash Table, Math, String | Easy | 89 | 64.9% |
| 5 | Best Time to Buy and Sell Stock Array, Dynamic Programming | Easy | 88 | 55.3% |
| 6 | Two Sum Array, Hash Table | Easy | 85 | 55.8% |
| 7 | Count Ways to Group Overlapping Ranges Array, Sorting | Medium | 85 | 38.1% |
| 8 | Meeting Rooms II Array, Two Pointers, Greedy, Sorting, Heap (Priority Queue), Prefix Sum | Medium | 83 | 52.1% |
| 9 | Rotate Image Array, Math, Matrix | Medium | 81 | 77.9% |
| 10 | Number of Divisible Triplet Sums Array, Hash Table | Medium | 81 | 67.8% |
| 11 | Minimum Absolute Difference Array, Sorting | Easy | 81 | 70.7% |
| 12 | Minimum Operations to Make All Array Elements Equal Array, Binary Search, Sorting, Prefix Sum | Medium | 81 | 36.9% |
| 13 | Minimum Operations to Make Median of Array Equal to K Array, Greedy, Sorting | Medium | 76 | 46.7% |
| 14 | Maximum Profitable Triplets With Increasing Prices I Array, Binary Indexed Tree, Segment Tree | Medium | 74 | 54.5% |
| 15 | Find The First Player to win K Games in a Row Array, Simulation | Medium | 74 | 39.4% |
| 16 | Activity Participants Database | Medium | 74 | 72.3% |
| 17 | The kth Factor of n Math, Number Theory | Medium | 74 | 69.6% |
| 18 | Find Products of Elements of Big Array Array, Binary Search, Bit Manipulation | Hard | 72 | 21.8% |
| 19 | Merge Intervals Array, Sorting | Medium | 72 | 49.4% |
| 20 | Type of Triangle Array, Math, Sorting | Easy | 72 | 44.8% |
| 21 | Taking Maximum Energy From the Mystic Dungeon Array, Prefix Sum | Medium | 72 | 41.1% |
| 22 | Find Occurrences of an Element in an Array Array, Hash Table | Medium | 72 | 72.6% |
| 23 | Find the Array Concatenation Value Array, Two Pointers, Simulation | Easy | 72 | 71.0% |
| 24 | String Compression Two Pointers, String | Medium | 72 | 58.1% |
| 25 | Minimum Levels to Gain More Points Array, Prefix Sum | Medium | 72 | 39.1% |
| 26 | Sort the Students by Their Kth Score Array, Sorting, Matrix | Medium | 72 | 85.6% |
| 27 | Longest Substring Without Repeating Characters Hash Table, String, Sliding Window | Medium | 72 | 36.9% |
| 28 | Average Value of Even Numbers That Are Divisible by Three Array, Math | Easy | 72 | 61.7% |
| 29 | Count the Number of Incremovable Subarrays II Array, Two Pointers, Binary Search | Hard | 72 | 39.0% |
| 30 | Minimum Length of String After Operations Hash Table, String, Counting | Medium | 72 | 74.9% |
| 31 | Maximum Profitable Triplets With Increasing Prices II Array, Binary Indexed Tree, Segment Tree | Hard | 72 | 43.3% |
| 32 | Count Vowel Strings in Ranges Array, String, Prefix Sum | Medium | 72 | 67.9% |
| 33 | Maximum Units on a Truck Array, Greedy, Sorting | Easy | 69 | 74.3% |
| 34 | Longest Common Prefix String, Trie | Easy | 69 | 45.5% |
| 35 | Get Equal Substrings Within Budget String, Binary Search, Sliding Window, Prefix Sum | Medium | 67 | 59.0% |
| 36 | Count Binary Substrings Two Pointers, String | Easy | 67 | 65.9% |
| 37 | Valid Parentheses String, Stack | Easy | 67 | 42.3% |
| 38 | Minimum Suffix Flips String, Greedy | Medium | 64 | 73.5% |
| 39 | Letter Combinations of a Phone Number Hash Table, String, Backtracking | Medium | 64 | 63.9% |
| 40 | Maximum Sum of Distinct Subarrays With Length K Array, Hash Table, Sliding Window | Medium | 64 | 42.6% |
| 41 | Numbers With Repeated Digits Math, Dynamic Programming | Hard | 64 | 43.5% |
| 42 | Longest Palindromic Substring Two Pointers, String, Dynamic Programming | Medium | 60 | 35.8% |
| 43 | Lexicographically Smallest String After Substring Operation String, Greedy | Medium | 60 | 32.3% |
| 44 | Merge Sorted Array Array, Two Pointers, Sorting | Easy | 60 | 52.9% |
| 45 | Longest Consecutive Sequence Array, Hash Table, Union Find | Medium | 60 | 47.0% |
| 46 | Count Pairs Of Similar Strings Array, Hash Table, String, Bit Manipulation, Counting | Easy | 56 | 72.5% |
| 47 | Maximum Subarray Array, Divide and Conquer, Dynamic Programming | Medium | 56 | 52.1% |
| 48 | Shortest and Lexicographically Smallest Beautiful String String, Sliding Window | Medium | 56 | 39.7% |
| 49 | Spiral Matrix Array, Matrix, Simulation | Medium | 56 | 53.9% |
| 50 | Number of Divisible Substrings Hash Table, String, Counting, Prefix Sum | Medium | 56 | 73.4% |
| 51 | Validate Binary Search Tree Tree, Depth-First Search, Binary Search Tree, Binary Tree | Medium | 51 | 34.4% |
| 52 | Smallest Missing Non-negative Integer After Operations Array, Hash Table, Math, Greedy | Medium | 51 | 39.9% |
| 53 | Subarray Product Less Than K Array, Binary Search, Sliding Window, Prefix Sum | Medium | 51 | 52.9% |
| 54 | Climbing Stairs Math, Dynamic Programming, Memoization | Easy | 51 | 53.5% |
| 55 | Divide Players Into Teams of Equal Skill Array, Hash Table, Two Pointers, Sorting | Medium | 51 | 68.9% |
| 56 | Minimum Swaps to Group All 1's Together II Array, Sliding Window | Medium | 51 | 65.5% |
| 57 | Group Anagrams Array, Hash Table, String, Sorting | Medium | 51 | 70.9% |
| 58 | Find Minimum in Rotated Sorted Array Array, Binary Search | Medium | 44 | 52.6% |
| 59 | Median of Two Sorted Arrays Array, Binary Search, Divide and Conquer | Hard | 44 | 43.8% |
| 60 | Subsets Array, Backtracking, Bit Manipulation | Medium | 44 | 80.9% |
| 61 | Find the Index of the First Occurrence in a String Two Pointers, String, String Matching | Easy | 44 | 45.0% |
| 62 | Subarray Sum Equals K Array, Hash Table, Prefix Sum | Medium | 44 | 45.5% |
| 63 | Number of Operations to Make Network Connected Depth-First Search, Breadth-First Search, Union Find, Graph | Medium | 44 | 64.7% |
| 64 | Palindrome Number Math | Easy | 44 | 59.2% |
| 65 | Next Permutation Array, Two Pointers | Medium | 44 | 43.1% |
| 66 | Backspace String Compare Two Pointers, String, Stack, Simulation | Easy | 44 | 49.5% |
| 67 | Trapping Rain Water Array, Two Pointers, Dynamic Programming, Stack, Monotonic Stack | Hard | 44 | 65.1% |
| 68 | Odd String Difference Array, Hash Table, String | Easy | 44 | 61.1% |
| 69 | Single-Threaded CPU Array, Sorting, Heap (Priority Queue) | Medium | 44 | 46.5% |
| 70 | Rotate Array Array, Math, Two Pointers | Medium | 44 | 43.0% |
| 71 | Product of Array Except Self Array, Prefix Sum | Medium | 44 | 67.8% |
| 72 | Longest Increasing Subsequence Array, Binary Search, Dynamic Programming | Medium | 44 | 57.8% |
| 73 | Flipping an Image Array, Two Pointers, Bit Manipulation, Matrix, Simulation | Easy | 44 | 83.0% |
| 74 | Flip String to Monotone Increasing String, Dynamic Programming | Medium | 44 | 61.6% |
| 75 | Find The Original Array of Prefix Xor Array, Bit Manipulation | Medium | 44 | 88.1% |
| 76 | Intersection of Two Arrays Array, Hash Table, Two Pointers, Binary Search, Sorting | Easy | 44 | 76.5% |
| 77 | N-Queens Array, Backtracking | Hard | 35 | 72.8% |
| 78 | Find All Possible Stable Binary Arrays II Dynamic Programming, Prefix Sum | Hard | 35 | 25.9% |
| 79 | Removing Stars From a String String, Stack, Simulation | Medium | 35 | 78.0% |
| 80 | Minimum Number of Flips to Make the Binary String Alternating String, Dynamic Programming, Sliding Window | Medium | 35 | 40.5% |
| 81 | Rearrange Array to Maximize Prefix Score Array, Greedy, Sorting, Prefix Sum | Medium | 35 | 41.5% |
| 82 | Range Product Queries of Powers Array, Bit Manipulation, Prefix Sum | Medium | 35 | 41.9% |
| 83 | Happy Number Hash Table, Math, Two Pointers | Easy | 35 | 58.1% |
| 84 | Degree of an Array Array, Hash Table | Easy | 35 | 57.4% |
| 85 | Generate Parentheses String, Dynamic Programming, Backtracking | Medium | 35 | 77.1% |
| 86 | LRU Cache Hash Table, Linked List, Design, Doubly-Linked List | Medium | 35 | 45.2% |
| 87 | Majority Element Array, Hash Table, Divide and Conquer, Sorting, Counting | Easy | 35 | 65.7% |
| 88 | Find the Duplicate Number Array, Two Pointers, Binary Search, Bit Manipulation | Medium | 35 | 62.8% |
| 89 | Increasing Triplet Subsequence Array, Greedy | Medium | 35 | 39.1% |
| 90 | Find Longest Calls Database | Medium | 35 | 62.8% |
| 91 | Partition Equal Subset Sum Array, Dynamic Programming | Medium | 35 | 48.4% |
| 92 | 132 Pattern Array, Binary Search, Stack, Monotonic Stack, Ordered Set | Medium | 35 | 34.1% |
| 93 | The Employee That Worked on the Longest Task Array | Easy | 35 | 50.6% |
| 94 | Count Number of Teams Array, Dynamic Programming, Binary Indexed Tree, Segment Tree | Medium | 35 | 70.1% |
| 95 | Least Number of Unique Integers after K Removals Array, Hash Table, Greedy, Sorting, Counting | Medium | 35 | 63.4% |
| 96 | Task Scheduler Array, Hash Table, Greedy, Sorting, Heap (Priority Queue), Counting | Medium | 35 | 61.5% |
| 97 | Minimum Operations to Reduce an Integer to 0 Dynamic Programming, Greedy, Bit Manipulation | Medium | 35 | 57.3% |
| 98 | Prime In Diagonal Array, Math, Matrix, Number Theory | Easy | 35 | 36.2% |
| 99 | Word Break Array, Hash Table, String, Dynamic Programming, Trie, Memoization | Medium | 35 | 48.3% |
| 100 | Maximum Number of Tasks You Can Assign Array, Two Pointers, Binary Search, Greedy, Queue, Sorting, Monotonic Queue | Hard | 35 | 50.6% |
How to read this list
The tabs at the top split the questions by how recently people said they were asked in interviews. "Last 30 Days" is the past month, "Last 3 Months" is the past quarter, and so on. "All Time" is every question on record for this company.
Frequency is a score from 0 to 100 for how often a question showed up in that time window. A higher number means it came up more often, so the list starts with the most common questions first. Acceptance is the share of submissions that pass on LeetCode. Click any question to open it on LeetCode.