IBM interview prep
Practice 30 problems from community-reported IBM interviews.
Your progress
0 / 30- Easy 0 / 11
- Medium 0 / 18
- Hard 0 / 1
Solved problems are saved in this browser.
Ranked problems
30 problems| Solved | Problem | Difficulty | Company lists |
|---|---|---|---|
Breadth-first searchCount tree nodes whose distances to three given targets, sorted as a, b and c, satisfy a² + b² = c². On the IBM list. |
Medium | ||
StacksCheck whether a string of round, square, and curly brackets closes every opening bracket in the correct order. On the Amazon, Google, Microsoft, Meta, IBM, Oracle lists. |
Easy | ||
GreedyEach ball sells for the number of balls of its color still in stock. Maximize revenue while filling a fixed number of orders. On the IBM list. |
Medium | ||
IntervalsCombine overlapping intervals and return a list that covers the same ranges without overlaps. On the Amazon, Microsoft, IBM, Oracle, J.P. Morgan, Morgan Stanley lists. |
Medium | ||
Data structure designImplement expiring tokens with operations to generate a token, renew an unexpired token, and count tokens still valid at a given time. On the IBM, Oracle lists. |
Medium | ||
StringsBuild the output for 1 through n, replacing multiples of three with Fizz, multiples of five with Buzz, and multiples of both with FizzBuzz. On the IBM list. |
Easy | ||
StringsConvert a positive integer to Roman numerals, including subtractive forms such as IV and IX. On the IBM list. |
Medium | ||
Two pointersChoose two vertical lines that, together with the x-axis, can hold the greatest area of water. On the Amazon, Google, Microsoft, Meta, IBM, Oracle lists. |
Medium | ||
Hash tablesDecide whether two strings contain exactly the same characters with the same multiplicities. On the Google, Microsoft, Meta, IBM, Oracle lists. |
Easy | ||
GreedyFind the fewest letters to insert into a string of a, b and c so the result consists entirely of consecutive copies of abc. On the IBM list. |
Medium | ||
ArraysRearrange the array in place so its values alternate strictly up and down, starting with an upward step. On the IBM list. |
Medium | ||
StringsReturn the longest contiguous part of a string that reads the same forward and backward. On the Amazon, Google, Microsoft, Meta, Tekion, IBM, Oracle, J.P. Morgan lists. |
Medium | ||
Dynamic programmingChoosing a number earns its value and eliminates all occurrences of its neighboring values. Find the highest score you can earn. On the IBM, Morgan Stanley lists. |
Medium | ||
StringsCount all contiguous substrings that read the same backward and forward. Count occurrences at different positions separately. On the IBM list. |
Medium | ||
Sliding windowFind the length of the longest contiguous stretch of a string in which no character appears twice. On the Amazon, Google, Microsoft, Meta, Tekion, IBM, Oracle, J.P. Morgan, Morgan Stanley lists. |
Medium | ||
ArraysGiven daily prices, find the best profit from buying once and selling on a later day. Return zero if no trade makes money. On the Amazon, Google, Microsoft, Meta, IBM, J.P. Morgan, Morgan Stanley lists. |
Easy | ||
StringsFind the longest substring in which each letter is exactly one place after the preceding letter in the alphabet. On the IBM list. |
Medium | ||
CountingCount binary substrings made of two consecutive runs of equal length, one of zeros and one of ones in either order. On the IBM, J.P. Morgan lists. |
Easy | ||
StringsFind the longest starting sequence of characters shared by every string in a list. On the Amazon, Google, Microsoft, Meta, IBM lists. |
Easy | ||
Linked listsReturn the middle node of a singly linked list. If there are two middle nodes, return the second. On the IBM list. |
Easy | ||
Linked listsReturn the node where a cycle begins in a singly linked list, or null if following the links eventually reaches the end. On the IBM list. |
Medium | ||
Two pointersTurn a string into a palindrome using as few character replacements as possible. Among equally short edits, choose the alphabetically smallest result. On the IBM list. |
Easy | ||
StringsRead a Roman numeral and compute its integer value, accounting for smaller symbols that precede larger ones. On the Google, Microsoft, IBM lists. |
Easy | ||
GreedySplit the marbles into k consecutive bags. Each bag scores the sum of its two end weights. Find the difference between the highest and lowest total scores. On the IBM list. |
Hard | ||
25Two Sum
Hash tablesFind the indices of two different elements in an array whose values add up to a given target. On the Amazon, Google, Microsoft, Meta, Samsung, Tekion, IBM, Oracle, J.P. Morgan, Morgan Stanley lists. Try Reveal the indices
|
Easy | ||
IntervalsAssign each interval to one of two labeled groups so overlapping intervals always stay together. Count the valid assignments. On the IBM list. |
Medium | ||
Prefix sumsCount how many nonempty contiguous parts of an integer array have a sum of exactly k. On the Amazon, Google, Microsoft, Meta, IBM, J.P. Morgan lists. |
Medium | ||
ArraysEach query asks for the index of a particular occurrence of a target value. Return −1 when that occurrence does not exist. On the IBM list. |
Medium | ||
GreedyYou may increment one matrix cell by one per move. Find the fewest moves that make every column strictly increasing from top to bottom. On the IBM list. |
Easy | ||
Two pointersFind the longest contiguous segment that rises strictly and then falls strictly, with at least one step on each side of the peak. On the IBM list. |
Medium |
How are questions ranked?
Company lists follow community-reported interview frequency. Ties keep the source order. Where a list uses two sources, we keep the first list’s ranks and fill the remaining places with the highest-ranked distinct problems from the second.
Across companies, first place earns 30 points and each subsequent rank earns one fewer. We add each problem’s points and break ties alphabetically.
- IBM · Ranks 1–24 · Six months · 21 October 2026
Ranks 25–30 · All time · 21 October 2026