# IBM Coding Interview Questions

> 170 DSA problems asked in IBM coding interviews and online assessments, sorted easiest first with hints. Free practice for placements on InternHack.

Canonical: https://www.internhack.in/learn/dsa/companies/ibm
Last updated: 2026-11-28

170 DSA problems tagged as asked in IBM coding interviews and online assessments. Below are the first 100 of 170: 52 easy, 32 medium and 16 hard. Start with the easy ones, then move to medium. Practise free on InternHack and track your progress.

## IBM DSA problems, easiest first

1. [Add Binary](https://www.internhack.in/learn/dsa/problem/add-binary) (Easy)
2. [Average Value of Even Numbers That Are Divisible by Three](https://www.internhack.in/learn/dsa/problem/average-value-of-even-numbers-that-are-divisible-by-three) (Easy)
3. [Backspace String Compare](https://www.internhack.in/learn/dsa/problem/backspace-string-compare) (Easy)
4. [Best Time to Buy and Sell Stock](https://www.internhack.in/learn/dsa/problem/best-time-to-buy-and-sell-stock) (Easy)
5. [Big Countries](https://www.internhack.in/learn/dsa/problem/big-countries) (Easy)
6. [Check if Array Is Sorted and Rotated](https://www.internhack.in/learn/dsa/problem/check-if-array-is-sorted-and-rotated) (Easy)
7. [Climbing Stairs](https://www.internhack.in/learn/dsa/problem/climbing-stairs) (Easy)
8. [Contains Duplicate](https://www.internhack.in/learn/dsa/problem/contains-duplicate) (Easy)
9. [Count Binary Substrings](https://www.internhack.in/learn/dsa/problem/count-binary-substrings) (Easy)
10. [Count Pairs Of Similar Strings](https://www.internhack.in/learn/dsa/problem/count-pairs-of-similar-strings) (Easy)
11. [Find Pivot Index](https://www.internhack.in/learn/dsa/problem/find-pivot-index) (Easy)
12. [Find Resultant Array After Removing Anagrams](https://www.internhack.in/learn/dsa/problem/find-resultant-array-after-removing-anagrams) (Easy)
13. [Find the Array Concatenation Value](https://www.internhack.in/learn/dsa/problem/find-the-array-concatenation-value) (Easy)
14. [Find the Index of the First Occurrence in a String](https://www.internhack.in/learn/dsa/problem/find-the-index-of-the-first-occurrence-in-a-string) (Easy)
15. [First Unique Character in a String](https://www.internhack.in/learn/dsa/problem/first-unique-character-in-a-string) (Easy)
16. [Fizz Buzz](https://www.internhack.in/learn/dsa/problem/fizz-buzz) (Easy)
17. [Flipping an Image](https://www.internhack.in/learn/dsa/problem/flipping-an-image) (Easy)
18. [Height Checker](https://www.internhack.in/learn/dsa/problem/height-checker) (Easy)
19. [Intersection of Two Arrays II](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays-ii) (Easy)
20. [Kth Missing Positive Number](https://www.internhack.in/learn/dsa/problem/kth-missing-positive-number) (Easy)
21. [Largest Number After Digit Swaps by Parity](https://www.internhack.in/learn/dsa/problem/largest-number-after-digit-swaps-by-parity) (Easy)
22. [Last Stone Weight](https://www.internhack.in/learn/dsa/problem/last-stone-weight) (Easy)
23. [Linked List Cycle](https://www.internhack.in/learn/dsa/problem/linked-list-cycle) (Easy)
24. [Longest Common Prefix](https://www.internhack.in/learn/dsa/problem/longest-common-prefix) (Easy)
25. [Majority Element](https://www.internhack.in/learn/dsa/problem/majority-element) (Easy)
26. [Max Consecutive Ones](https://www.internhack.in/learn/dsa/problem/max-consecutive-ones) (Easy)
27. [Maximum Units on a Truck](https://www.internhack.in/learn/dsa/problem/maximum-units-on-a-truck) (Easy)
28. [Merge Sorted Array](https://www.internhack.in/learn/dsa/problem/merge-sorted-array) (Easy)
29. [Merge Strings Alternately](https://www.internhack.in/learn/dsa/problem/merge-strings-alternately) (Easy)
30. [Middle of the Linked List](https://www.internhack.in/learn/dsa/problem/middle-of-the-linked-list) (Easy)
31. [Minimum Absolute Difference](https://www.internhack.in/learn/dsa/problem/minimum-absolute-difference) (Easy)
32. [Minimum Bit Flips to Convert Number](https://www.internhack.in/learn/dsa/problem/minimum-bit-flips-to-convert-number) (Easy)
33. [Minimum Operations to Make Columns Strictly Increasing](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-columns-strictly-increasing) (Easy)
34. [Minimum String Length After Removing Substrings](https://www.internhack.in/learn/dsa/problem/minimum-string-length-after-removing-substrings) (Easy)
35. [Minimum Time to Type Word Using Special Typewriter](https://www.internhack.in/learn/dsa/problem/minimum-time-to-type-word-using-special-typewriter) (Easy)
36. [Minimum Value to Get Positive Step by Step Sum](https://www.internhack.in/learn/dsa/problem/minimum-value-to-get-positive-step-by-step-sum) (Easy)
37. [Missing Number](https://www.internhack.in/learn/dsa/problem/missing-number) (Easy)
38. [Move Zeroes](https://www.internhack.in/learn/dsa/problem/move-zeroes) (Easy)
39. [Odd String Difference](https://www.internhack.in/learn/dsa/problem/odd-string-difference) (Easy)
40. [Palindrome Number](https://www.internhack.in/learn/dsa/problem/palindrome-number) (Easy)
41. [Plus One](https://www.internhack.in/learn/dsa/problem/plus-one) (Easy)
42. [Remove Duplicates from Sorted Array](https://www.internhack.in/learn/dsa/problem/remove-duplicates-from-sorted-array) (Easy)
43. [Reverse Linked List](https://www.internhack.in/learn/dsa/problem/reverse-linked-list) (Easy)
44. [Roman to Integer](https://www.internhack.in/learn/dsa/problem/roman-to-integer) (Easy)
45. [Search Insert Position](https://www.internhack.in/learn/dsa/problem/search-insert-position) (Easy)
46. [The Employee That Worked on the Longest Task](https://www.internhack.in/learn/dsa/problem/the-employee-that-worked-on-the-longest-task) (Easy)
47. [Two Sum](https://www.internhack.in/learn/dsa/problem/two-sum) (Easy)
48. [Type of Triangle](https://www.internhack.in/learn/dsa/problem/type-of-triangle) (Easy)
49. [Valid Anagram](https://www.internhack.in/learn/dsa/problem/valid-anagram) (Easy)
50. [Valid Palindrome II](https://www.internhack.in/learn/dsa/problem/valid-palindrome-ii) (Easy)
51. [Valid Parentheses](https://www.internhack.in/learn/dsa/problem/valid-parentheses) (Easy)
52. [Water Bottles](https://www.internhack.in/learn/dsa/problem/water-bottles) (Easy)
53. [Count Vowel Strings in Ranges](https://www.internhack.in/learn/dsa/problem/count-vowel-strings-in-ranges) (Medium)
54. [Count Ways to Group Overlapping Ranges](https://www.internhack.in/learn/dsa/problem/count-ways-to-group-overlapping-ranges) (Medium)
55. [Divide Intervals Into Minimum Number of Groups](https://www.internhack.in/learn/dsa/problem/divide-intervals-into-minimum-number-of-groups) (Medium)
56. [Find Longest Calls](https://www.internhack.in/learn/dsa/problem/find-longest-calls) (Medium)
57. [Find Occurrences of an Element in an Array](https://www.internhack.in/learn/dsa/problem/find-occurrences-of-an-element-in-an-array) (Medium)
58. [Find The First Player to win K Games in a Row](https://www.internhack.in/learn/dsa/problem/find-the-first-player-to-win-k-games-in-a-row) (Medium)
59. [Lexicographically Smallest String After Substring Operation](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-string-after-substring-operation) (Medium)
60. [Make Lexicographically Smallest Array by Swapping Elements](https://www.internhack.in/learn/dsa/problem/make-lexicographically-smallest-array-by-swapping-elements) (Medium)
61. [Maximum Profitable Triplets With Increasing Prices I](https://www.internhack.in/learn/dsa/problem/maximum-profitable-triplets-with-increasing-prices-i) (Medium)
62. [Maximum Sum of Distinct Subarrays With Length K](https://www.internhack.in/learn/dsa/problem/maximum-sum-of-distinct-subarrays-with-length-k) (Medium)
63. [Maximum Value at a Given Index in a Bounded Array](https://www.internhack.in/learn/dsa/problem/maximum-value-at-a-given-index-in-a-bounded-array) (Medium)
64. [Minimize Maximum Pair Sum in Array](https://www.internhack.in/learn/dsa/problem/minimize-maximum-pair-sum-in-array) (Medium)
65. [Minimize XOR](https://www.internhack.in/learn/dsa/problem/minimize-xor) (Medium)
66. [Minimum Levels to Gain More Points](https://www.internhack.in/learn/dsa/problem/minimum-levels-to-gain-more-points) (Medium)
67. [Minimum Number of Changes to Make Binary String Beautiful](https://www.internhack.in/learn/dsa/problem/minimum-number-of-changes-to-make-binary-string-beautiful) (Medium)
68. [Minimum Number of Flips to Make the Binary String Alternating](https://www.internhack.in/learn/dsa/problem/minimum-number-of-flips-to-make-the-binary-string-alternating) (Medium)
69. [Minimum Number of Swaps to Make the String Balanced](https://www.internhack.in/learn/dsa/problem/minimum-number-of-swaps-to-make-the-string-balanced) (Medium)
70. [Minimum Operations to Make All Array Elements Equal](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-all-array-elements-equal) (Medium)
71. [Minimum Operations to Make Median of Array Equal to K](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-median-of-array-equal-to-k) (Medium)
72. [Minimum Swaps to Group All 1's Together II](https://www.internhack.in/learn/dsa/problem/minimum-swaps-to-group-all-1s-together-ii) (Medium)
73. [Number of Divisible Substrings](https://www.internhack.in/learn/dsa/problem/number-of-divisible-substrings) (Medium)
74. [Number of Divisible Triplet Sums](https://www.internhack.in/learn/dsa/problem/number-of-divisible-triplet-sums) (Medium)
75. [Optimal Partition of String](https://www.internhack.in/learn/dsa/problem/optimal-partition-of-string) (Medium)
76. [Rearrange Array to Maximize Prefix Score](https://www.internhack.in/learn/dsa/problem/rearrange-array-to-maximize-prefix-score) (Medium)
77. [Remove All Occurrences of a Substring](https://www.internhack.in/learn/dsa/problem/remove-all-occurrences-of-a-substring) (Medium)
78. [Remove Colored Pieces if Both Neighbors are the Same Color](https://www.internhack.in/learn/dsa/problem/remove-colored-pieces-if-both-neighbors-are-the-same-color) (Medium)
79. [Removing Stars From a String](https://www.internhack.in/learn/dsa/problem/removing-stars-from-a-string) (Medium)
80. [Shortest and Lexicographically Smallest Beautiful String](https://www.internhack.in/learn/dsa/problem/shortest-and-lexicographically-smallest-beautiful-string) (Medium)
81. [Single-Threaded CPU](https://www.internhack.in/learn/dsa/problem/single-threaded-cpu) (Medium)
82. [Smallest Missing Non-negative Integer After Operations](https://www.internhack.in/learn/dsa/problem/smallest-missing-non-negative-integer-after-operations) (Medium)
83. [Sort the Students by Their Kth Score](https://www.internhack.in/learn/dsa/problem/sort-the-students-by-their-kth-score) (Medium)
84. [Taking Maximum Energy From the Mystic Dungeon](https://www.internhack.in/learn/dsa/problem/taking-maximum-energy-from-the-mystic-dungeon) (Medium)
85. [Candy](https://www.internhack.in/learn/dsa/problem/candy) (Hard)
86. [Count the Number of Incremovable Subarrays II](https://www.internhack.in/learn/dsa/problem/count-the-number-of-incremovable-subarrays-ii) (Hard)
87. [Find All Possible Stable Binary Arrays II](https://www.internhack.in/learn/dsa/problem/find-all-possible-stable-binary-arrays-ii) (Hard)
88. [Find Products of Elements of Big Array](https://www.internhack.in/learn/dsa/problem/find-products-of-elements-of-big-array) (Hard)
89. [Last Substring in Lexicographical Order](https://www.internhack.in/learn/dsa/problem/last-substring-in-lexicographical-order) (Hard)
90. [Longest Valid Parentheses](https://www.internhack.in/learn/dsa/problem/longest-valid-parentheses) (Hard)
91. [Maximum Profitable Triplets With Increasing Prices II](https://www.internhack.in/learn/dsa/problem/maximum-profitable-triplets-with-increasing-prices-ii) (Hard)
92. [Median of Two Sorted Arrays](https://www.internhack.in/learn/dsa/problem/median-of-two-sorted-arrays) (Hard)
93. [Merge k Sorted Lists](https://www.internhack.in/learn/dsa/problem/merge-k-sorted-lists) (Hard)
94. [Minimum Insertion Steps to Make a String Palindrome](https://www.internhack.in/learn/dsa/problem/minimum-insertion-steps-to-make-a-string-palindrome) (Hard)
95. [Minimum Number of Increments on Subarrays to Form a Target Array](https://www.internhack.in/learn/dsa/problem/minimum-number-of-increments-on-subarrays-to-form-a-target-array) (Hard)
96. [Minimum Number of Moves to Make Palindrome](https://www.internhack.in/learn/dsa/problem/minimum-number-of-moves-to-make-palindrome) (Hard)
97. [Minimum Window Substring](https://www.internhack.in/learn/dsa/problem/minimum-window-substring) (Hard)
98. [N-Queens](https://www.internhack.in/learn/dsa/problem/n-queens) (Hard)
99. [Sliding Window Maximum](https://www.internhack.in/learn/dsa/problem/sliding-window-maximum) (Hard)
100. [Trapping Rain Water](https://www.internhack.in/learn/dsa/problem/trapping-rain-water) (Hard)

## Prepare for the rest of the IBM process

- [Aptitude questions by company](https://www.internhack.in/learn/aptitude/companies)
- [Technical interview questions](https://www.internhack.in/learn/interview)
- [Free ATS resume check](https://www.internhack.in/ats-score/try), no signup

## Other companies

- [Google](https://www.internhack.in/learn/dsa/companies/google) (2217)
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon) (1938)
- [Meta](https://www.internhack.in/learn/dsa/companies/meta) (1387)
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft) (1352)
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg) (1173)
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok) (383)
- [Uber](https://www.internhack.in/learn/dsa/companies/uber) (381)
- [Apple](https://www.internhack.in/learn/dsa/companies/apple) (356)
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle) (340)
- [Goldman Sachs](https://www.internhack.in/learn/dsa/companies/goldman-sachs) (270)
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe) (227)
- [TCS](https://www.internhack.in/learn/dsa/companies/tcs) (217)
- [Salesforce](https://www.internhack.in/learn/dsa/companies/salesforce) (189)
- [Linkedin](https://www.internhack.in/learn/dsa/companies/linkedin) (180)
- [Zoho](https://www.internhack.in/learn/dsa/companies/zoho) (179)
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys) (158)
- [Walmart Labs](https://www.internhack.in/learn/dsa/companies/walmart-labs) (152)
- [Accenture](https://www.internhack.in/learn/dsa/companies/accenture) (144)
- [Nvidia](https://www.internhack.in/learn/dsa/companies/nvidia) (137)
- [Yandex](https://www.internhack.in/learn/dsa/companies/yandex) (134)
- [DE Shaw](https://www.internhack.in/learn/dsa/companies/de-shaw) (124)
- [Visa](https://www.internhack.in/learn/dsa/companies/visa) (124)
- [Flipkart](https://www.internhack.in/learn/dsa/companies/flipkart) (117)
- [Paypal](https://www.internhack.in/learn/dsa/companies/paypal) (106)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA by company](https://www.internhack.in/learn/dsa/companies)
