You process a chronologically-sorted stream of health-check events for one service: a list of dicts {"ts": str (ISO 8601), "ok": bool}.
Raise an alert at a failure (ok == False) when at least threshold failures (including the current one) have occurred within the trailing window_minutes minutes — i.e. in the closed interval [ts - window, ts] (a failure exactly window_minutes earlier still counts). Only failures count toward the threshold; successful checks never alert, don't count, and don't reset anything.
Return the list of alert timestamps (the ts strings), in order.
What the tests check
6 on Run · 7 on Submit01no failures, no alerts
02single failure below threshold
03threshold reached within window alerts at the Nth failure
04window boundary is inclusive
05a failure just older than the window does not count
06successful checks in the window don't count toward the threshold
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.