InterviewLegend

Strings & Hashing

Alex Chen28 min readUpdated 328 real interview reports

After the array problem, the next thing an IBM assessment tends to hand you is a string. A username to validate, maybe, or a log line to parse. Sometimes it's a form field that has to line up with another field. Almost every one of them gets solved by counting characters and reading the tallies, or by dropping things into a hash set so "have I seen this before" costs nothing. That's why strings and hashing travel as a pair. Together they're close to 28% of IBM's coding, in a near tie with the grouping cluster for second place behind arrays.

The venue is the same HackerRank screen the arrays live on: commonly two problems in about sixty minutes, rated easy to medium, scored by an autograder that either passes your code or does not. These problems read as friendly. The traps sit quietly in the hidden tests: the empty string, a mix of upper and lower case, the character that shows up exactly once, two inputs of different length. A frequency map that survives those corners scores. A slick one-liner that silently assumes lowercase ASCII fails on the input it never pictured.

The IBM angle
On IBM's screen nobody discusses your solution with you. The grader runs it, and the corner you skip sinks you. No interviewer is there to give you credit for a good idea that mishandles an edge, and on string problems the grader's favorite hidden inputs are the ones the friendly examples leave out. Read the enterprise-flavored prompt closely, decide up front whether case and whitespace matter, and cover the empty string and the length mismatch before you reach for anything clever. A boring pass that's correct on every planted corner is what clears this stage.
What's inside
  • 3 problems, worked step by step
  • about 28 min

Premium lessonIBM interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your IBM interview?Tell us what they asked. Reviewed before it goes in, never with your name.
IBM interview guide

Know what IBM asks before you walk in.

14 coding · 3 system design · 13 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.