InterviewDB Question

Number of Runs: Count Consecutive Equal-Element Segments in an Array

Question Details

Problem A "run" is a maximal contiguous subarray of equal elements. Given an array, return the number of runs. Example: Round 2 - Variant Return not just the count but also the encoded form: [(value, length)] pairs (run-length encoding). Example: Then decode it back: Follow-ups What is the time and space complexity of encoding and decoding? For what types of data does run-length encoding provide the most compression? How would you handle this for a stream of data (you cannot load the full array…

Full Details

🔒

Unlock all Roblox questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a reported interview question from a roblox interview during the phone round.

It covers the following topics: Arrays, Coding, Phone, Onsite .