Ibm logo IB
Verified Company Vault 30d Active

Ibm DSA Interview Questions

178 curated coding interview questions directly asked in Ibm technical rounds, sorted by frequency with recency and difficulty diagnostics.

178 Total Questions
54 (30%) Easy Problems
106 (60%) Medium Problems
18 (10%) Hard Problems
🔥 Most Tested Topics:
Arrays (75)Strings (49)Core DSA (47)Trees (13)Heap (8)
📂 Sourced Datasets:
Last 30 daysLast 3 monthsLast 6 monthsAll questionsOlder than 6 months
Showing 178 of 178 displayed
IDProblemDifficultyTopicPatternAcceptanceFrequencyRecency
20Valid ParenthesesEasyStringsHashing / Sliding Window44.2%100.0%30d
3Longest Substring Without Repeating CharactersMediumStrings; TreesHashing / Sliding Window; DFS / BFS; Sliding Window39.1%100.0%30d
412Fizz BuzzEasyCore DSAImplementation / Reasoning75.5%100.0%3m
560Subarray Sum Equals KMediumArraysSorting / Prefix / Scan47.3%100.0%3m
2580Count Ways to Group Overlapping RangesMediumCore DSAImplementation / Reasoning39.1%87.5%all
76Minimum Window SubstringHardArrays; Strings; TreesSorting / Prefix / Scan; Hashing / Sliding Window; DFS / BFS; Sliding Window47.5%75.0%6m
3627Maximum Median Sum of Subsequences of Size 3MediumArrays; HeapSorting / Prefix / Scan; Priority Queue65.1%75.0%6m
881Boats to Save PeopleMediumCore DSAImplementation / Reasoning61.8%75.0%6m
1526Minimum Number of Increments on Subarrays to Form a Target ArrayHardArraysSorting / Prefix / Scan78.2%75.0%6m
32Longest Valid ParenthesesHardStringsHashing / Sliding Window38.8%75.0%6m
2964Number of Divisible Triplet SumsMediumArraysSorting / Prefix / Scan67.6%75.0%all
1200Minimum Absolute DifferenceEasyArraysSorting / Prefix / Scan75.1%75.0%all
3107Minimum Operations to Make Median of Array Equal to KMediumArrays; HeapSorting / Prefix / Scan; Priority Queue47.9%75.0%all
3175Find The First Player to win K Games in a RowMediumCore DSAImplementation / Reasoning40.3%75.0%all
1355Activity ParticipantsMediumCore DSAImplementation / Reasoning72.0%75.0%all
2602Minimum Operations to Make All Array Elements EqualMediumArraysSorting / Prefix / Scan38.4%75.0%all
453Minimum Moves to Equal Array ElementsMediumArraysSorting / Prefix / Scan58.7%75.0%all
12Integer to RomanMediumStringsHashing / Sliding Window71.0%62.5%3m
1888Minimum Number of Flips to Make the Binary String AlternatingMediumArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window53.5%62.5%3m
1758Minimum Changes To Make Alternating Binary StringEasyArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window67.8%62.5%3m
647Palindromic SubstringsMediumStrings; TreesHashing / Sliding Window; DFS / BFS72.8%62.5%3m
1Two SumEasyArraysSorting / Prefix / Scan; Two Pointers57.5%62.5%3m
72Edit DistanceMediumDynamic ProgrammingState Transition60.6%62.5%3m
435Non-overlapping IntervalsMediumArrays; GreedySorting / Prefix / Scan; Greedy57.1%62.5%3m
48Rotate ImageMediumArraysSorting / Prefix / Scan80.1%62.5%3m
680Valid Palindrome IIEasyStringsHashing / Sliding Window44.3%62.5%3m
56Merge IntervalsMediumArraysSorting / Prefix / Scan51.8%62.5%3m
121Best Time to Buy and Sell StockEasyCore DSAImplementation / Reasoning56.8%62.5%3m
13Roman to IntegerEasyStringsHashing / Sliding Window66.6%62.5%6m
1685Sum of Absolute Differences in a Sorted ArrayMediumArraysSorting / Prefix / Scan68.4%62.5%6m
17Letter Combinations of a Phone NumberMediumStrings; BacktrackingHashing / Sliding Window; Backtracking66.1%62.5%all
49Group AnagramsMediumStringsHashing / Sliding Window72.6%62.5%all
2907Maximum Profitable Triplets With Increasing Prices IMediumArraysSorting / Prefix / Scan55.9%62.5%all
2921Maximum Profitable Triplets With Increasing Prices IIHardArraysSorting / Prefix / Scan46.1%62.5%all
3024Type of TriangleEasyCore DSAImplementation / Reasoning44.1%62.5%all
3096Minimum Levels to Gain More PointsMediumArraysSorting / Prefix / Scan40.4%62.5%all
3147Taking Maximum Energy From the Mystic DungeonMediumArraysSorting / Prefix / Scan61.0%62.5%all
3145Find Products of Elements of Big ArrayHardArraysSorting / Prefix / Scan24.8%62.5%all
2455Average Value of Even Numbers That Are Divisible by ThreeEasyCore DSAImplementation / Reasoning63.2%62.5%all
2545Sort the Students by Their Kth ScoreMediumArrays; HeapSorting / Prefix / Scan; Priority Queue86.0%62.5%all
2562Find the Array Concatenation ValueEasyArraysSorting / Prefix / Scan72.0%62.5%all
1710Maximum Units on a TruckEasyArraysSorting / Prefix / Scan74.9%62.5%all
3223Minimum Length of String After OperationsMediumArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window75.1%62.5%all
696Count Binary SubstringsEasyStrings; TreesHashing / Sliding Window; DFS / BFS70.4%62.5%all
2972Count the Number of Incremovable Subarrays IIHardArraysSorting / Prefix / Scan40.2%62.5%all
1319Number of Operations to Make Network ConnectedMediumGraphsBFS / DFS / Topological Sort66.5%62.5%all
2559Count Vowel Strings in RangesMediumStringsHashing / Sliding Window67.8%62.5%all
2734Lexicographically Smallest String After Substring OperationMediumStrings; Trees; GraphsHashing / Sliding Window; DFS / BFS; BFS / DFS / Topological Sort34.9%62.5%all
2461Maximum Sum of Distinct Subarrays With Length KMediumArraysSorting / Prefix / Scan43.0%62.5%all
242Valid AnagramEasyStringsHashing / Sliding Window68.1%62.5%all
3402Minimum Operations to Make Columns Strictly IncreasingEasyArraysSorting / Prefix / Scan72.7%62.5%all
724Find Pivot IndexEasyCore DSAImplementation / Reasoning62.7%62.5%all
845Longest Mountain in ArrayMediumArraysSorting / Prefix / Scan42.1%62.5%all
1004Max Consecutive Ones IIIMediumCore DSAImplementation / Reasoning67.7%62.5%all
1518Water BottlesEasyCore DSAImplementation / Reasoning72.6%62.5%all
754Reach a NumberMediumCore DSAImplementation / Reasoning45.1%62.5%all
153SumMediumArraysSorting / Prefix / Scan39.1%50.0%6m
2405Optimal Partition of StringMediumStrings; Dynamic ProgrammingHashing / Sliding Window; State Transition78.4%50.0%6m
2193Minimum Number of Moves to Make PalindromeHardArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window52.8%50.0%6m
1513Number of Substrings With Only 1sMediumStrings; TreesHashing / Sliding Window; DFS / BFS57.4%50.0%6m
42Trapping Rain WaterHardCore DSATwo Pointers67.4%50.0%6m
9Palindrome NumberEasyStringsHashing / Sliding Window60.6%50.0%6m
3159Find Occurrences of an Element in an ArrayMediumArraysSorting / Prefix / Scan73.4%50.0%6m
5Longest Palindromic SubstringMediumStrings; TreesHashing / Sliding Window; DFS / BFS37.8%50.0%6m
2429Minimize XORMediumCore DSAImplementation / Reasoning62.4%50.0%6m
322Coin ChangeMediumDynamic ProgrammingState Transition48.4%50.0%6m
253Meeting Rooms IIMediumGreedyGreedy52.7%50.0%6m
875Koko Eating BananasMediumBinary SearchBinary Search50.0%50.0%6m
215Kth Largest Element in an ArrayMediumArrays; HeapSorting / Prefix / Scan; Priority Queue68.9%50.0%6m
146LRU CacheMediumDesignData Structure Design47.4%50.0%6m
371Sum of Two IntegersMediumArraysSorting / Prefix / Scan55.5%50.0%6m
1283Find the Smallest Divisor Given a ThresholdMediumCore DSAImplementation / Reasoning65.9%50.0%6m
2402Meeting Rooms IIIHardGreedyGreedy51.5%50.0%6m
14Longest Common PrefixEasyCore DSAImplementation / Reasoning47.6%50.0%all
53Maximum SubarrayMediumArraysSorting / Prefix / Scan53.3%50.0%all
128Longest Consecutive SequenceMediumCore DSAImplementation / Reasoning47.1%50.0%all
238Product of Array Except SelfMediumArraysSorting / Prefix / Scan68.9%50.0%all
443String CompressionMediumStringsHashing / Sliding Window60.0%50.0%all
636Exclusive Time of FunctionsMediumCore DSAImplementation / Reasoning66.2%50.0%all
98Validate Binary Search TreeMediumStrings; Trees; Binary SearchHashing / Sliding Window; DFS / BFS; Binary Search35.8%50.0%all
70Climbing StairsEasyDynamic ProgrammingState Transition54.1%50.0%all
844Backspace String CompareEasyStringsHashing / Sliding Window49.9%50.0%all
54Spiral MatrixMediumArraysSorting / Prefix / Scan56.8%50.0%all
2950Number of Divisible SubstringsMediumStrings; TreesHashing / Sliding Window; DFS / BFS74.6%50.0%all
2506Count Pairs Of Similar StringsEasyStringsHashing / Sliding Window73.7%50.0%all
2696Minimum String Length After Removing SubstringsEasyArrays; Strings; TreesSorting / Prefix / Scan; Hashing / Sliding Window; DFS / BFS77.2%50.0%all
3295Report Spam MessageMediumCore DSAImplementation / Reasoning48.7%50.0%all
2231Largest Number After Digit Swaps by ParityEasyCore DSAImplementation / Reasoning65.4%50.0%all
1768Merge Strings AlternatelyEasyArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window82.1%50.0%all
1051Height CheckerEasyCore DSAImplementation / Reasoning81.7%50.0%all
11Container With Most WaterMediumCore DSATwo Pointers60.0%50.0%all
283Move ZeroesEasyCore DSATwo Pointers63.8%50.0%all
1167Minimum Cost to Connect SticksMediumArraysSorting / Prefix / Scan71.9%50.0%all
239Sliding Window MaximumHardArraysSorting / Prefix / Scan; Sliding Window48.8%50.0%all
4Median of Two Sorted ArraysHardArrays; HeapSorting / Prefix / Scan; Priority Queue46.6%37.5%all
2904Shortest and Lexicographically Smallest Beautiful StringMediumStrings; GraphsHashing / Sliding Window; BFS / DFS / Topological Sort41.1%37.5%all
88Merge Sorted ArrayEasyArraysSorting / Prefix / Scan54.9%37.5%all
169Majority ElementEasyCore DSAImplementation / Reasoning66.3%37.5%all
189Rotate ArrayMediumArraysSorting / Prefix / Scan44.9%37.5%all
1208Get Equal Substrings Within BudgetMediumStrings; TreesHashing / Sliding Window; DFS / BFS59.7%37.5%all
2432The Employee That Worked on the Longest TaskEasyCore DSAImplementation / Reasoning51.7%37.5%all
1395Count Number of TeamsMediumCore DSAImplementation / Reasoning70.2%37.5%all
2598Smallest Missing Non-negative Integer After OperationsMediumArraysSorting / Prefix / Scan56.0%37.5%all
1834Single-Threaded CPUMediumCore DSAImplementation / Reasoning47.7%37.5%all
78SubsetsMediumBacktrackingBacktracking82.3%37.5%all
153Find Minimum in Rotated Sorted ArrayMediumArrays; Binary SearchSorting / Prefix / Scan; Binary Search54.7%37.5%all
832Flipping an ImageEasyCore DSAImplementation / Reasoning83.7%37.5%all
51N-QueensHardBacktrackingBacktracking75.5%37.5%all
926Flip String to Monotone IncreasingMediumStringsHashing / Sliding Window61.9%37.5%all
2587Rearrange Array to Maximize Prefix ScoreMediumArraysSorting / Prefix / Scan42.8%37.5%all
2134Minimum Swaps to Group All 1's Together IIMediumArraysSorting / Prefix / Scan65.6%37.5%all
3130Find All Possible Stable Binary Arrays IIHardArraysSorting / Prefix / Scan58.9%37.5%all
2451Odd String DifferenceEasyStringsHashing / Sliding Window62.0%37.5%all
2390Removing Stars From a StringMediumStringsHashing / Sliding Window79.3%37.5%all
2406Divide Intervals Into Minimum Number of GroupsMediumArraysSorting / Prefix / Scan63.6%37.5%all
268Missing NumberEasyArraysSorting / Prefix / Scan72.0%37.5%all
1974Minimum Time to Type Word Using Special TypewriterEasyArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window78.7%37.5%all
2038Remove Colored Pieces if Both Neighbors are the Same ColorMediumCore DSAImplementation / Reasoning63.1%37.5%all
2593Sum SmallerMediumArraysSorting / Prefix / Scan51.4%37.5%all
1910Remove All Occurrences of a SubstringMediumStrings; TreesHashing / Sliding Window; DFS / BFS78.5%37.5%all
210Course Schedule IIMediumGraphsBFS / DFS / Topological Sort55.5%37.5%all
767Reorganize StringMediumStringsHashing / Sliding Window57.1%37.5%all
2948Make Lexicographically Smallest Array by Swapping ElementsMediumArrays; GraphsSorting / Prefix / Scan; BFS / DFS / Topological Sort60.3%37.5%all
200Number of IslandsMediumGraphsBFS / DFS / Topological Sort64.4%37.5%all
1752Check if Array Is Sorted and RotatedEasyArrays; Binary SearchSorting / Prefix / Scan; Binary Search57.3%37.5%all
1539Kth Missing Positive NumberEasyArrays; HeapSorting / Prefix / Scan; Priority Queue63.5%37.5%all
7Reverse IntegerMediumCore DSAImplementation / Reasoning31.9%37.5%all
206Reverse Linked ListEasyLinked ListTwo Pointers80.6%37.5%all
451Sort Characters By FrequencyMediumArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window75.3%37.5%all
1413Minimum Value to Get Positive Step by Step SumEasyArraysSorting / Prefix / Scan64.7%37.5%all
217Contains DuplicateEasyArraysSorting / Prefix / Scan64.4%37.5%all
89Gray CodeMediumCore DSAImplementation / Reasoning64.9%37.5%all
151Reverse Words in a StringMediumStringsHashing / Sliding Window56.4%37.5%all
66Plus OneEasyCore DSAImplementation / Reasoning50.0%37.5%all
67Add BinaryEasyCore DSAImplementation / Reasoning58.1%37.5%all
135CandyHardCore DSAImplementation / Reasoning48.5%37.5%all
901Online Stock SpanMediumCore DSAImplementation / Reasoning69.1%37.5%all
33Search in Rotated Sorted ArrayMediumArrays; Binary SearchSorting / Prefix / Scan; Binary Search44.9%37.5%all
141Linked List CycleEasyLinked ListTwo Pointers54.3%37.5%all
350Intersection of Two Arrays IIEasyArraysSorting / Prefix / Scan59.9%37.5%all
79Word SearchMediumStrings; Binary SearchHashing / Sliding Window; Binary Search47.4%37.5%all
1963Minimum Number of Swaps to Make the String BalancedMediumArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window78.0%37.5%all
1163Last Substring in Lexicographical OrderHardStrings; Trees; GraphsHashing / Sliding Window; DFS / BFS; BFS / DFS / Topological Sort35.0%37.5%all
921Minimum Add to Make Parentheses ValidMediumArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window74.4%37.5%all
35Search Insert PositionEasyBinary SearchBinary Search51.3%37.5%all
45Jump Game IIMediumGreedyGreedy42.9%37.5%all
475HeatersMediumCore DSAImplementation / Reasoning41.9%37.5%all
1052Grumpy Bookstore OwnerMediumCore DSAImplementation / Reasoning64.0%37.5%all
23Merge k Sorted ListsHardArrays; Linked List; HeapSorting / Prefix / Scan; Two Pointers; Priority Queue59.6%37.5%all
1802Maximum Value at a Given Index in a Bounded ArrayMediumArraysSorting / Prefix / Scan38.9%37.5%all
1604Alert Using Same Key-Card Three or More Times in a One Hour PeriodMediumCore DSAImplementation / Reasoning46.3%37.5%all
876Middle of the Linked ListEasyLinked ListTwo Pointers81.8%37.5%all
26Remove Duplicates from Sorted ArrayEasyArraysSorting / Prefix / Scan; Two Pointers62.8%37.5%all
155Min StackMediumStack / QueueMonotonic Stack / Simulation58.2%37.5%all
31Next PermutationMediumBacktrackingBacktracking45.3%37.5%all
735Asteroid CollisionMediumCore DSAImplementation / Reasoning47.9%37.5%all
2220Minimum Bit Flips to Convert NumberEasyArraysSorting / Prefix / Scan87.9%37.5%all
994Rotting OrangesMediumCore DSAImplementation / Reasoning58.7%37.5%all
1046Last Stone WeightEasyCore DSAImplementation / Reasoning66.5%37.5%all
71Simplify PathMediumCore DSAImplementation / Reasoning50.6%37.5%all
387First Unique Character in a StringEasyStringsHashing / Sliding Window65.5%37.5%all
1877Minimize Maximum Pair Sum in ArrayMediumArraysSorting / Prefix / Scan83.3%37.5%all
2Add Two NumbersMediumCore DSAImplementation / Reasoning48.5%37.5%all
2273Find Resultant Array After Removing AnagramsEasyArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window69.9%37.5%all
1312Minimum Insertion Steps to Make a String PalindromeHardArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window73.9%37.5%all
763Partition LabelsMediumDynamic ProgrammingState Transition81.9%37.5%all
22Generate ParenthesesMediumStringsHashing / Sliding Window78.7%37.5%all
485Max Consecutive OnesEasyCore DSAImplementation / Reasoning65.2%37.5%all
3521Find Product Recommendation PairsMediumArraysSorting / Prefix / Scan61.9%37.5%all
992Subarrays with K Different IntegersHardArraysSorting / Prefix / Scan68.1%37.5%all
75Sort ColorsMediumArraysSorting / Prefix / Scan69.6%37.5%all
152Maximum Product SubarrayMediumArraysSorting / Prefix / Scan36.4%37.5%all
1838Frequency of the Most Frequent ElementMediumCore DSAImplementation / Reasoning44.8%37.5%all
191Number of 1 BitsEasyCore DSAImplementation / Reasoning76.8%37.5%all
2116Check if a Parentheses String Can Be ValidMediumStringsHashing / Sliding Window45.2%37.5%all
202Happy NumberEasyCore DSAImplementation / Reasoning59.7%37.5%all
347Top K Frequent ElementsMediumHeapPriority Queue66.4%37.5%all
941Valid Mountain ArrayEasyArrays; StringsSorting / Prefix / Scan; Hashing / Sliding Window35.3%37.5%all