Python data engineering interview problem. Difficulty: beginner. Pattern: Strings. About 10 minutes. Part of the Pro drill bank.
A verbose event log repeats the same character (or code) many times in a row. Compaction stores run-length pairs to save space.
Compact a run-length encoded event log (compress consecutive repeats).
Input: rle_compress('aaabbc') Output: 'a3b2c1' This input follows the stated rules and produces this output.
Topics: lakebench, python, strings.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Compress a sequence of repeated status codes into a run-length encoded form.
Compact a run-length encoded event log (compress consecutive repeats).