IBM Interview Questions — 100 DSA Problems
93 problems with full solutions in Python, Java, C++, JavaScript, Go, Rust.
Most frequently asked IBM LeetCode questions for software engineering interviews.
- Exclusive Time of Functions (MEDIUM) — Array, Stack
- Integer to Roman (MEDIUM) — Hash Table, Math, String
- Fizz Buzz (EASY) — Math, String, Simulation
- Roman to Integer (EASY) — Hash Table, Math, String
- Best Time to Buy and Sell Stock (EASY) — Array, Dynamic Programming
- Two Sum (EASY) — Array, Hash Table
- Count Ways to Group Overlapping Ranges (MEDIUM) — Array, Sorting
- Meeting Rooms II (MEDIUM) — Array, Two Pointers, Greedy, Sorting, Heap (Priority Queue), Prefix Sum
- Rotate Image (MEDIUM) — Array, Math, Matrix
- Number of Divisible Triplet Sums (MEDIUM) — Array, Hash Table
- Minimum Absolute Difference (EASY) — Array, Sorting
- Minimum Operations to Make All Array Elements Equal (MEDIUM) — Array, Binary Search, Sorting, Prefix Sum
- Minimum Operations to Make Median of Array Equal to K (MEDIUM) — Array, Greedy, Sorting
- Maximum Profitable Triplets With Increasing Prices I (MEDIUM) — Array, Binary Indexed Tree, Segment Tree
- Find The First Player to win K Games in a Row (MEDIUM) — Array, Simulation
- Activity Participants (MEDIUM) — Database
- The kth Factor of n (MEDIUM) — Math, Number Theory
- Find Products of Elements of Big Array (HARD) — Array, Binary Search, Bit Manipulation
- Merge Intervals (MEDIUM) — Array, Sorting
- Type of Triangle (EASY) — Array, Math, Sorting
- Taking Maximum Energy From the Mystic Dungeon (MEDIUM) — Array, Prefix Sum
- Find Occurrences of an Element in an Array (MEDIUM) — Array, Hash Table
- Find the Array Concatenation Value (EASY) — Array, Two Pointers, Simulation
- String Compression (MEDIUM) — Two Pointers, String
- Minimum Levels to Gain More Points (MEDIUM) — Array, Prefix Sum
- Sort the Students by Their Kth Score (MEDIUM) — Array, Sorting, Matrix
- Longest Substring Without Repeating Characters (MEDIUM) — Hash Table, String, Sliding Window
- Average Value of Even Numbers That Are Divisible by Three (EASY) — Array, Math
- Count the Number of Incremovable Subarrays II (HARD) — Array, Two Pointers, Binary Search
- Minimum Length of String After Operations (MEDIUM) — Hash Table, String, Counting
- Maximum Profitable Triplets With Increasing Prices II (HARD) — Array, Binary Indexed Tree, Segment Tree
- Count Vowel Strings in Ranges (MEDIUM) — Array, String, Prefix Sum
- Maximum Units on a Truck (EASY) — Array, Greedy, Sorting
- Longest Common Prefix (EASY) — String, Trie
- Get Equal Substrings Within Budget (MEDIUM) — String, Binary Search, Sliding Window, Prefix Sum
- Count Binary Substrings (EASY) — Two Pointers, String
- Valid Parentheses (EASY) — String, Stack
- Minimum Suffix Flips (MEDIUM) — String, Greedy
- Letter Combinations of a Phone Number (MEDIUM) — Hash Table, String, Backtracking
- Maximum Sum of Distinct Subarrays With Length K (MEDIUM) — Array, Hash Table, Sliding Window
- Numbers With Repeated Digits (HARD) — Math, Dynamic Programming
- Longest Palindromic Substring (MEDIUM) — Two Pointers, String, Dynamic Programming
- Lexicographically Smallest String After Substring Operation (MEDIUM) — String, Greedy
- Merge Sorted Array (EASY) — Array, Two Pointers, Sorting
- Longest Consecutive Sequence (MEDIUM) — Array, Hash Table, Union Find
- Count Pairs Of Similar Strings (EASY) — Array, Hash Table, String, Bit Manipulation, Counting
- Maximum Subarray (MEDIUM) — Array, Divide and Conquer, Dynamic Programming
- Shortest and Lexicographically Smallest Beautiful String (MEDIUM) — String, Sliding Window
- Spiral Matrix (MEDIUM) — Array, Matrix, Simulation
- Number of Divisible Substrings (MEDIUM) — Hash Table, String, Counting, Prefix Sum
I
IBM
100 questions tracked93 with solutions
Frequency scoreSorted highest → lowest frequency✓ Our Solution = we have a detailed walkthrough
Showing 100 of 100 questions
8MediumMeeting Rooms II
ArrayTwo PointersGreedySorting+2
10MediumNumber of Divisible Triplet Sums
ArrayHash Table
12MediumMinimum Operations to Make All Array Elements Equal✓ Our Solution ArrayBinary SearchSortingPrefix Sum
13MediumMinimum Operations to Make Median of Array Equal to K✓ Our Solution ArrayGreedySorting
14MediumMaximum Profitable Triplets With Increasing Prices I
ArrayBinary Indexed TreeSegment Tree
16MediumActivity Participants
Database
18ArrayBinary SearchBit Manipulation
23ArrayTwo PointersSimulation
27Hash TableStringSliding Window
28EasyAverage Value of Even Numbers That Are Divisible by Three✓ Our Solution ArrayMath
29ArrayTwo PointersBinary Search
31HardMaximum Profitable Triplets With Increasing Prices II
ArrayBinary Indexed TreeSegment Tree
35StringBinary SearchSliding WindowPrefix Sum
39Hash TableStringBacktracking
40ArrayHash TableSliding Window
42Two PointersStringDynamic Programming
43MediumLexicographically Smallest String After Substring Operation✓ Our Solution StringGreedy
45ArrayHash TableUnion Find
46ArrayHash TableStringBit Manipulation+1
47ArrayDivide and ConquerDynamic Programming
48MediumShortest and Lexicographically Smallest Beautiful String✓ Our Solution StringSliding Window
50MediumNumber of Divisible Substrings
Hash TableStringCountingPrefix Sum
51TreeDepth-First SearchBinary Search TreeBinary Tree
52MediumSmallest Missing Non-negative Integer After Operations✓ Our Solution ArrayHash TableMathGreedy
53ArrayBinary SearchSliding WindowPrefix Sum
54MathDynamic ProgrammingMemoization
55ArrayHash TableTwo PointersSorting
57ArrayHash TableStringSorting
59ArrayBinary SearchDivide and Conquer
60ArrayBacktrackingBit Manipulation
61Two PointersStringString Matching
62ArrayHash TablePrefix Sum
63Depth-First SearchBreadth-First SearchUnion FindGraph
66Two PointersStringStackSimulation
67ArrayTwo PointersDynamic ProgrammingStack+1
69ArraySortingHeap (Priority Queue)
72ArrayBinary SearchDynamic Programming
73ArrayTwo PointersBit ManipulationMatrix+1
74StringDynamic Programming
76ArrayHash TableTwo PointersBinary Search+1
78Dynamic ProgrammingPrefix Sum
80MediumMinimum Number of Flips to Make the Binary String Alternating✓ Our Solution StringDynamic ProgrammingSliding Window
81ArrayGreedySortingPrefix Sum
82ArrayBit ManipulationPrefix Sum
83Hash TableMathTwo Pointers
85StringDynamic ProgrammingBacktracking
86Hash TableLinked ListDesignDoubly-Linked List
87ArrayHash TableDivide and ConquerSorting+1
88ArrayTwo PointersBinary SearchBit Manipulation
90MediumFind Longest Calls
Database
92ArrayBinary SearchStackMonotonic Stack+1
94ArrayDynamic ProgrammingBinary Indexed TreeSegment Tree
95ArrayHash TableGreedySorting+1
96ArrayHash TableGreedySorting+2
97Dynamic ProgrammingGreedyBit Manipulation
98ArrayMathMatrixNumber Theory
99ArrayHash TableStringDynamic Programming+2
100ArrayTwo PointersBinary SearchGreedy+3