← Questions

String compression and decompression

0
NvidiaAirbnbCodingLast asked Nov 2026

A coding interview question asked in Airbnb's technical phone screen and at Nvidia, last asked Nov 2026. It tests strings, encoding and run-length encoding.

Write a pair of functions that compress a string with run-length encoding and decompress it back exactly. Each run of a repeated character becomes the character followed by the length of the run, so aaabcc becomes a3b1c2.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

strings · encoding · run-length encoding

Your code and the AI tutor open when you unlock this question.