Skip to main content

IBM Coding Interview Questions

25 IBM coding interview problems with full optimal solutions — 12 easy, 13 medium, 0 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an IBM interviewer values, and a FAQ section.

Showing 13 problems of 25

  • #3mediumfrequently asked

    3. Longest Substring Without Repeating Characters

    Longest Substring Without Repeating Characters is IBM's sliding-window screener. The interviewer is grading whether you reach for the dynamic-window technique with a last-seen index map, whether you handle the 'jump the left pointer' optimization, and whether you ship O(n) with a single pass.

    3 free resourcesSolve →
  • #15mediumfrequently asked

    15. 3Sum

    3Sum is IBM's two-pointer-on-sorted-array screener. The interviewer is grading whether you sort first to enable the two-pointer pattern, whether you skip duplicates cleanly at all three pointer positions, and whether you arrive at O(n^2) instead of the naive O(n^3).

    3 free resourcesSolve →
  • #49mediumfrequently asked

    49. Group Anagrams

    Group Anagrams is IBM's hash-keyed-bucketing screener. The interviewer is grading whether you pick a canonical key (sort the chars OR a frequency tuple), articulate the tradeoff between O(k log k) sort and O(k) counter, and ship the bucket map cleanly.

    3 free resourcesSolve →
  • #53mediumfrequently asked

    53. Maximum Subarray

    Maximum Subarray is IBM's Kadane's-algorithm screener. The interviewer is grading whether you can derive Kadane's by stating the 'extend-or-restart' decision rule, ship it in O(n) with O(1) space, and articulate how it generalizes to the 2D variant.

    4 free resourcesSolve →
  • #56mediumfrequently asked

    56. Merge Intervals

    Merge Intervals is IBM's sort-then-sweep screener — directly relevant to calendar scheduling and time-range queries in IBM Cloud monitoring. The interviewer is grading whether you sort by start, whether you handle the touching-but-not-overlapping edge case, and whether you ship O(n log n) cleanly.

    3 free resourcesSolve →
  • #102mediumfrequently asked

    102. Binary Tree Level Order Traversal

    Binary Tree Level Order Traversal is IBM's BFS-on-trees screener. The interviewer is grading whether you reach for an explicit queue, whether you use the queue-size snapshot trick to delimit levels, and whether you handle the empty-tree edge case cleanly.

    3 free resourcesSolve →
  • #139mediumfrequently asked

    139. Word Break

    Word Break is IBM's DP-on-strings screener. The interviewer is grading whether you recognize the 'can-be-split' DP recurrence, whether you build the Set for O(1) word lookup, and whether you bound the inner loop by the maximum word length to avoid pathological inputs.

    3 free resourcesSolve →
  • #146mediumcompany favorite

    146. LRU Cache

    LRU Cache is IBM's data-structure-design screener — relevant to IBM Cloud / DB2 / storage teams where eviction policies matter daily. The interviewer is grading whether you reach for hash map + doubly linked list together, articulate why neither suffices alone, and ship O(1) for both get and put.

    4 free resourcesSolve →
  • #200mediumfrequently asked

    200. Number of Islands

    Number of Islands is IBM's graph-traversal screener — a 2D grid where each connected region of land cells counts as one island. The interviewer is grading whether you pick BFS or DFS deliberately, articulate the stack-depth risk on huge maps, and handle the in-place vs visited-set trade.

    3 free resourcesSolve →
  • #207mediumfrequently asked

    207. Course Schedule

    Course Schedule is IBM's cycle-detection-in-directed-graph screener — directly relevant to dependency-graph problems in IBM Cloud orchestration and DB2 query planning. The interviewer is grading whether you reach for topological sort (Kahn's or DFS-coloring), whether you handle disconnected nodes, and whether you finish in O(V+E).

    4 free resourcesSolve →
  • #215mediumfrequently asked

    215. Kth Largest Element in an Array

    Kth Largest Element is IBM's heap/quickselect screener. The interviewer is grading whether you ship the O(n log k) min-heap solution under time pressure, whether you mention Quickselect for O(n) average, and whether you handle the duplicate-friendly definition correctly.

    4 free resourcesSolve →
  • #238mediumfrequently asked

    238. Product of Array Except Self

    Product of Array Except Self is IBM's prefix/suffix-array screener. The interviewer is grading whether you avoid the forbidden division operator, derive the two-pass left/right product technique, and ship it in O(1) extra space using the output array as your scratch.

    3 free resourcesSolve →
  • #322mediumfrequently asked

    322. Coin Change

    Coin Change is IBM's unbounded-knapsack DP screener. The interviewer is grading whether you recognize the unbounded variant (each coin reusable), whether you ship the O(amount * coins) bottom-up DP, and whether you handle the impossible case (amount > 0 but no combination works) cleanly.

    3 free resourcesSolve →

Related interview-prep guides

Interview Platforms

HireVue Tech Interview Guide: The 2026 Playbook for Async Video Rounds

HireVue is the category-leading async video interview platform. Candidates record answers solo, on the clock, and a combined AI-plus-human review layer scores the recording days later. For 2026 tech jobseekers, the format is different enough from live interviews to need its own playbook. This guide is that playbook.

Interview Platforms

HackerRank Tech Interview Guide 2026: What It Tests, How It Tracks You, and the Modern Setup

HackerRank is still the volume leader in first-round technical screens for 2026 tech hiring. A browser-sandboxed coding environment that logs every keystroke, paste event, and tab-focus change inside its own tab. This guide covers what it tests, the boundary of what it can and cannot detect, and how a modern desktop setup pairs with a HackerRank session without leaking into the screen-share.

Interview Platforms

Codility for Tech Interviews in 2026: The Complete Guide for Candidates

Codility is the dominant algorithmic-assessment platform across European tech hiring. Heavy in the UK, Germany, Netherlands, Nordics, and Poland where the company was founded. It scores candidates on both correctness and time complexity, runs 60-to-120-minute timed tests, and ships three products: Tests, CodeCheck, and CodeLive. This guide is what 2026 candidates need to know.

IBM Coding Interview Questions — Full Solutions — InterviewChamp.AI