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 12 problems of 25

  • #1easyfoundational

    1. Two Sum

    Two Sum is IBM's universal warm-up across SWE and intern phone screens. The interviewer is grading whether you can pivot from the obvious O(n^2) double loop to the one-pass hash-map solution and whether you can articulate the space-for-time tradeoff cleanly.

    3 free resourcesSolve →
  • #20easyfoundational

    20. Valid Parentheses

    Valid Parentheses is IBM's stack-pattern screener. The interviewer is grading whether you recognize the stack signature (matching pairs of arbitrary depth), whether you handle the closer-without-opener and unclosed-tail edge cases, and whether you finish in O(n) on a single pass.

    3 free resourcesSolve →
  • #21easyfoundational

    21. Merge Two Sorted Lists

    Merge Two Sorted Lists is IBM's pointer-discipline check for SWE-1 and intern phone screens. The interviewer is grading whether you reach for a sentinel/dummy node, whether you re-use existing nodes instead of allocating fresh ones, and whether your loop exit cleanly attaches the remaining tail.

    3 free resourcesSolve →
  • #70easyfrequently asked

    70. Climbing Stairs

    Climbing Stairs is IBM's intro-to-DP screener — the candidate's first chance to demonstrate they recognize Fibonacci, can derive the recurrence on the whiteboard, and can collapse the memoization to two scalar variables for O(1) space.

    3 free resourcesSolve →
  • #121easyfoundational

    121. Best Time to Buy and Sell Stock

    Best Time to Buy and Sell Stock is IBM's array-traversal screener for SWE phone screens and the Watson/Research data-engineering track. The interviewer is grading whether you can derive the running-minimum invariant on a single pass instead of falling into the brute-force double loop.

    3 free resourcesSolve →
  • #125easyfoundational

    125. Valid Palindrome

    Valid Palindrome is IBM's go-to string-parsing screener. The bar is whether you can articulate the two-pointer in-place approach, handle non-alphanumeric characters in the spec, and avoid the O(n) extra-space trap of building a normalized copy.

    3 free resourcesSolve →
  • #136easyfrequently asked

    136. Single Number

    Single Number is IBM's XOR-trick screener. The interviewer is grading whether you reach for the bitwise XOR pattern, articulate why it works (a XOR a = 0, a XOR 0 = a, XOR is commutative), and ship it in O(n) time with O(1) space.

    3 free resourcesSolve →
  • #141easyfrequently asked

    141. Linked List Cycle

    Linked List Cycle is IBM's Floyd's-tortoise-and-hare screener. The interviewer is grading whether you reach for the two-pointer technique unprompted, articulate why the fast pointer catches the slow one inside a cycle, and ship O(1) extra space.

    4 free resourcesSolve →
  • #206easyfoundational

    206. Reverse Linked List

    Reverse Linked List is IBM's canonical pointer warm-up across SWE phone screens. The interviewer is grading whether you can walk a singly linked list with three pointers without losing the tail and whether you can articulate the recursive variant's stack cost.

    3 free resourcesSolve →
  • #217easyfoundational

    217. Contains Duplicate

    Contains Duplicate is IBM's hash-set screener for SWE interns and SWE-1 phone screens. The interviewer is grading whether you reach for a Set in one pass, whether you can short-circuit early, and whether you name the sort vs hash space-time tradeoff cleanly.

    3 free resourcesSolve →
  • #242easyfrequently asked

    242. Valid Anagram

    Valid Anagram is IBM's hash-map screener. The interviewer is grading whether you can pick the right counting structure (array vs Map), handle the Unicode follow-up gracefully, and stay O(n) instead of falling into the O(n log n) sort trap.

    3 free resourcesSolve →
  • #704easyfoundational

    704. Binary Search

    Binary Search is IBM's correctness screener — the interviewer is grading whether you can write a bug-free binary search on the whiteboard, handle the overflow-safe midpoint, and articulate the loop-invariant. Surprisingly few candidates ship this on the first attempt.

    4 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