Arrays & Strings Interview Questions & Solutions

29 solutions ยท 12 Easy ยท 16 Medium ยท 1 Hard

Arrays and strings are where nearly every coding interview begins, and where sloppy fundamentals get exposed fastest. These problems look easy and often are โ€” but interviewers watch closely for whether you handle edge cases (empty input, single element, duplicates), whether you mutate in place when asked, and whether you reach for an O(n) prefix-sum or hash trick instead of a lazy O(nยฒ) double loop.

The solutions here build exactly those instincts. You'll work through prefix sums and running aggregates, in-place rearrangement and rotation, interval merging, and the string manipulation and parsing problems that trip people up under pressure. Each walkthrough is explicit about the time and space trade-offs, because "it works" is rarely enough in an interview โ€” the follow-up is always "can you do it faster, or without the extra array?" Get fluent here and the harder two-pointer, sliding-window, and hashing patterns will feel like natural extensions rather than new material.

Practice Arrays & Strings the right way

SkillFlow serves you Arrays & Strings problems matched to your level, times you like a real interview, and tracks your proficiency as it climbs. Free.

Start practicing free โ†’

Other interview patterns