IBM interview question
IBM online assessment: math and number theory, arrays and hashing
- Company:
- IBM
- Type:
- Coding
- Difficulty:
- Easy
- Reported:
- October 19, 2026
Problem
About this card
One candidate reported an IBM online assessment made up of two short coding tasks. This card is a study note on the two technique families those tasks belong to; it does not describe the tasks.
Math and number theory
These questions reward a little reasoning before any code. Useful tools include divisibility rules, the Euclidean algorithm for greatest common divisors, modular arithmetic for results that would otherwise get huge, and sieves for anything involving primes. Work a handful of small cases by hand, look for the pattern, and confirm it against a slow reference version. In languages with fixed-width integers, watch for overflow.
Arrays and hashing
Many array questions that look quadratic become linear with one pass and a dictionary or set of values seen so far. Grouping and counting with hash maps is the core move; be clear about what the key is and what the value stores.
How to practise
Do timed easy and medium problems from both families, keep a brute-force checker for small random inputs, and state the time and space complexity before you start coding.
Reported by candidates or drawn from publicly available sources, and rewritten in our own words. Pathwise Prep does not publish confidential assessment content. Report a concern