Back to ZipRecruiter questions
CodingSoftware Engineer

Salary-Range Histogram

Frequency: Reported


Reported prompt

The input is a list of salary ranges. No range may start below 0 or end above 300,000.

Draw buckets of width 5,000 from the minimum salary through the maximum salary. Fill each bucket with the number of jobs whose salary range falls into that bucket.

Reported example

text
input = [(100000, 105000), (110000, 110000), (114000, 115560)]

output = {
    100000: 1
    105000: 1
    110000: 2
    150000: 1
}

The reported 150000 output key appears to be a typo, likely for 115000. The source does not state the exact endpoint convention for assigning a salary range to buckets.