Alert Monitor: Recent Count, Hourly Severity, Volume Spikes

Asked at LinkedIn · Coding Questions · Difficulty: Medium · Last asked Feb 4, 2026

You are building the in-memory core of an alert dashboard. Alerts arrive as a stream in time order, each with a timestamp in seconds and a severity. The dashboard must answer three kinds of question quickly while the stream keeps growing: how many alerts arrived recently, how the current hour splits by severity, and which recent minutes were followed by a busier minute.

Loading the problem…