Liftoff·Software Engineer·Technical Phone Screen
- Implement an optimized run-length encoder that produces the shortest possible encoded string, where each encoded run has length at most K. You may break longer runs into repeated multi-character patterns if that yields a shorter result.
- Walk through the algorithm design for the optimized RLE problem. Why is a DP over prefixes a natural fit, and how do you structure the transitions?
- What is the time complexity of your solution, and how does it change depending on how you detect repeating patterns?
“The basic RLE part I had down.”