📈 Observability — interview questions

12 questions. Filter by what the role asks for; open one for the six layers of the answer. The course is where the answers come from.

12 of 12

01A teammate argues that a `log.debug("processing order " + order.describe())` line is harmless in production because DEBUG is disabled there — "if it's disabled, nothing happens." Is that true?Structured loggingeasy0-2y02A correlation id set at the start of a request via `MDC.put("correlationId", id)` shows up correctly on most log lines, but occasionally a log line from a completely different request carries it. What's the mechanism, and why does it only ever seem to happen under load?Structured loggingmedium3-5y03`grep "order 1041" app.log` returns lines about order 1041 and also lines about order 10412. Why, and how does switching to structured JSON logs fix it — not just "make it searchable", but mechanically?Structured loggingeasy0-2y04A username field is logged with `log.info("login attempt for " + username)`, and an attacker submits a username containing an embedded newline followed by a fabricated 'login succeeded for admin' line. Walk through exactly what ends up in the log file, and explain precisely why switching to structured JSON logging closes this — not generally, but mechanically.Security and logging hygienehard5-8y05A `LoginRequest` class overrides `toString()` so its `password` field prints as `[REDACTED]`. A teammate is confident this closes every path a password could leak through logging. Where are they wrong?Security and logging hygienehard5-8y06A dashboard shows average latency for an endpoint holding steady at 45 ms, and an alert is configured to page when that average exceeds 100 ms. Users are complaining about slow page loads. What's likely wrong with the alert, and what should it watch instead?Metrics and percentilesmedium3-5y07A Micrometer `Timer` is configured with `publishPercentileHistogram()` and bucket boundaries at 50ms, 100ms and 500ms. Explain exactly what `payment_charge_seconds_bucket{le="100"}` means as a number, why it necessarily includes everything counted in `le="50"`, and what `histogram_quantile` is actually computing when it estimates a percentile from these buckets.Metrics and percentileshard5-8y08A teammate adds `.tag("userId", userId)` to an existing HTTP request timer "so we can see per-user latency." What happens to the metrics platform, and why does this one line matter more than it looks like it should?Metrics and percentileseasy0-2y09A checkout request's trace looks complete and healthy in the tracing UI — but an asynchronous confirmation email, submitted to a thread pool from inside that same request, shows up as its own separate, single-span trace instead of a child span. Explain exactly why, using the propagation mechanism, not just 'context was lost.'Distributed tracingmedium3-5y10A platform team sets head sampling at 1% to control tracing storage cost. During an incident with a 0.1% failure rate, an engineer complains that almost none of the failed requests have a trace. Is that a bug, a misconfiguration, or expected behavior of head sampling — and what would tail sampling have done differently, at what cost?Distributed tracinghard8+y11A team's SLO period is 7 days, and they want a 'page' rule that fires once a sustained rate would spend 1% of that week's error budget within a 30-minute window. Derive the burn-rate threshold this rule should use, and explain why it isn't the same as the standard 14.4×-over-1-hour rule even though both are labeled 'page'.Alerting and SLOshard8+y12A static alert (`error rate > 1% over 5 minutes`) paged the on-call rotation 20 times in a month, 11 of which corresponded to no real incident, and 7 of which were actually the same slow-burning incident firing and clearing repeatedly. What's wrong with the rule's design, and how does a symptom-based burn-rate alert avoid both failure modes at once?Alerting and SLOsmedium3-5y