Skip to main content

Checkpoint: triage the incident

Challenge on lesson: Checkpoint: The Incident Triage

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".

Difficulty: advanced

Back to lesson: Checkpoint: The Incident Triage