Code Room
CodingMediumcod-g1310
Subject Log processingLevel Entry–Mid~13 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You are given the arrival times of requests at a web server as integer Unix seconds, in non-decreasing order (all values non-negative). Build a requests-per-minute series: minute buckets are aligned to multiples of 60, so a timestamp t belongs to bucket t / 60 rounded down. Return the count for every bucket from the first event's minute through the last event's minute, inclusive — quiet minutes in between must appear as 0. Return an empty list for an empty input.

Implement
requests_per_minute(timestamps: list[int]) → list[int]
Examples
in[[10,70,75,190]]out[1,2,0,1]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.