MEDIUMasked at 2 companies

String Compression III

A medium-tier problem at 67% community acceptance, tagged with String. Reported in interviews at Qualcomm and 1 others.

Founder's read

String Compression III is a medium-difficulty string problem with a 67% acceptance rate, asked by Qualcomm and Affirm. The problem tests whether you can recognize when a greedy compression strategy works and implement it cleanly under time pressure. Most candidates either over-engineer the solution or miss edge cases around consecutive character groups. If this hits your live assessment and you blank on the grouping logic, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
2
Difficulty
MEDIUM
Acceptance
67%

Companies that ask "String Compression III"

If this hits your live OA

String Compression III is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The trick is recognizing that you need to iterate through the string, count consecutive identical characters, and encode each run as the character followed by its count. The naive approach fails when candidates try to optimize prematurely or handle the count encoding incorrectly. Many also stumble on the final group if the string ends mid-run. The pattern is straightforward once you see it: iterate, count, append. Where candidates hit a wall is deciding how to track state efficiently and handling length-2 counts versus longer ones correctly. StealthCoder is your hedge if the pattern doesn't click immediately during the live OA.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

String Compression III recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

String Compression III interview FAQ

Is this problem actually easy or does the medium difficulty matter?+

The 67% acceptance rate and medium tag mean it's deceptively tricky. The core idea is simple, but off-by-one bugs in the counting loop or miscounting consecutive characters cost time in live interviews. Interviewers use it to separate thorough candidates from rushed ones.

What's the most common mistake candidates make?+

Forgetting to handle the last group after the loop ends, or encoding counts incorrectly when the count is 1 versus 2 or higher. Some candidates also misunderstand the problem and try to apply known compression schemes instead of the simple run-length approach.

Do Qualcomm and Affirm still ask this problem in OAs?+

Both have asked it according to public reports. Qualcomm in particular uses string manipulation problems heavily. If you're interviewing at either, practicing clean, bug-free grouping logic is non-negotiable.

Is this a prerequisite for harder string problems?+

Not strictly, but it teaches the pattern of iterating through strings with state tracking, which appears in palindrome checks and pattern matching. Nailing the fundamentals here builds confidence for more complex variants.

How long should this take in a real OA?+

Ten to fifteen minutes for a clean solution including a trace-through. If you're above that, you're probably overthinking or rewriting. The simplicity is the trap: candidates assume it must be harder than it is.

Want the actual problem statement? View "String Compression III" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.