Skip to main content

Checkpoint: triage the incident

Challenge on lesson: Checkpoint: The Incident Triage

CHALLENGE
Difficulty: advanced+25 XP

Events are lines ts=<n> level=<L> event=<E> requestId=<R> endpoint=<P> (already parsed for you as records). Inside Solution, implement static class Ev with long ts; String level, event, requestId, endpoint; and a constructor Ev(long, String, String, String, String), then: 1. static List<String> affectedRequests(List<Ev> events) โ€” requestIds that have at least one level=ERROR event, in first-appearance order, deduplicated. 2. static Map<String, Long> byEndpoint(List<Ev> events) โ€” count of ERROR events per endpoint. 3. static List<String> cascadeOf(List<Ev> events, String requestId) โ€” the event names for that request in ts order (its full timeline). 4. static String verdict(List<Ev> events) โ€” return "isolated" if exactly one request is affected, "endpoint-outage" if one endpoint accounts for ALL errors and there are 2+ affected requests, else "widespread". 5. static String refutes(String hypothesis) โ€” the observation that would kill each leading hypothesis: "endpoint-outage"โ†’"an error on a different endpoint", "isolated"โ†’"a second affected request", "widespread"โ†’"errors stop after deploy".

Back to lesson: Checkpoint: The Incident Triage