Skip to main content
πŸ”’ Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the the rest of the curriculum. Card required, cancel any time in Dashboard.Start 7-day trial β†’
⚑
← Coursesβ€ΊDevOps for Python servicesModule 4 Β· Observability & Logging Β· Recapβ€ΊπŸŽ― Review: DevOps module 4 recapscenario63 / 104
+80 XP
Task
Build `incident_severity(error_rate, p99_ms, users_affected)` returning one of `"SEV1"`, `"SEV2"`, `"SEV3"`, or `"SEV4"`: 1. `error_rate > 0.5` OR `users_affected > 10000` β†’ `"SEV1"` (page on-call immediately β€” blast radius is massive). 2. Else if `error_rate > 0.1` OR `p99_ms > 2000` β†’ `"SEV2"` (degraded; respond within 15 min). 3. Else if `error_rate > 0.01` OR `p99_ms > 500` OR `users_affected > 100` β†’ `"SEV3"` (visible; respond same business day). 4. Otherwise β†’ `"SEV4"` (cosmetic; file a ticket for the backlog). The order matters β€” higher severity wins on overlapping conditions.
✏️ Write your code here
🐍
Loading Python...
One-time download (~1 MB). Then it runs instantly.
πŸ“Š Result
Press Run to see result...

πŸ’¬ Discussion

Be the first to ask a question or share a tip.
Sign in to join the discussion. Reading is free.
Loading discussion…