Problem
Given timestamped log entries, bucket them into fixed-size time windows and count how many are errors in each window.
Input / Output
- Input: a stream of log entries, each with a timestamp and a level/type; a fixed window size.
- Output: a map from window (start time or index) to the count of errors in it.
Constraints
- Stream-friendly — entries arrive continuously and may be slightly out of order.
- Windows are fixed length (e.g. one minute).
Example
- With 1-minute windows: errors at 00:00:10, 00:00:50, and 00:01:05 → {00:00: 2, 00:01: 1}.