SLIs, SLOs, SLAs, and Error Budgets Questions
Defining and operating reliability targets. Covers choosing service level indicators, setting service level objectives and agreements, computing and spending error budgets, and using them to drive engineering decisions. Includes negotiating reliability targets with stakeholders.
Two downstream services disagree about whether a transaction succeeded (service A logs success, service B logs failure). As SRE, how do you compute a reliable SLI for end-to-end success rate? Propose reconciliation rules, authoritative sources, and instrumentation changes to reduce future inconsistencies.
Sample Answer
When two services disagree about a transaction's outcome, the safest default for computing a reliable SLI is to trust whichever service is the AUTHORITATIVE source of truth for that specific outcome, and treat any disagreement itself as a signal worth investigating, not just resolving and moving on.
Structured elaboration
Reconciliation rules: identify which service is genuinely authoritative for the specific claim in question (e.g. for a payment transaction, the payment processor's own confirmation is usually more authoritative than an internal service's inferred success/failure based on an HTTP response, since the internal service could have logged "success" based on receiving a request while the actual downstream processing failed asynchronously, or vice versa); where no single service is unambiguously authoritative, define an explicit, DOCUMENTED tiebreaker (e.g. "if A and B disagree and neither is authoritative for this specific field, default to the more conservative outcome, i.e. treat as failed, since falsely counting a transaction as successful when it wasn't is worse than the reverse for this use case"). Instrumentation changes to reduce future inconsistency: propagate a shared, canonical transaction-outcome field written by whichever service IS authoritative, and have all other services read (not independently re-derive) that field for their own logging and SLI computation, rather than each service independently inferring and logging its own opinion about the same event.
Worked example
For an e-commerce checkout where service A (the order service) logs success based on receiving an acknowledgment, and service B (the payment processor integration) logs failure because the payment actually failed asynchronously after A's acknowledgment was sent: B is authoritative here, since payment success/failure is squarely B's domain of truth, and A's SLI computation should be corrected to READ B's authoritative outcome rather than relying on its own earlier, now-known-to-be-wrong acknowledgment-based inference. Going forward, A's logging is changed to write "acknowledged" (not "success") for A's own internal event, and to derive its own "transaction succeeded" SLI directly from B's authoritative confirmation, closing the specific inconsistency this incident revealed.
Trade-offs and pitfalls
Defaulting to "trust whichever service reports first" or "trust whichever reports success" (an easy but wrong shortcut under time pressure) systematically biases the SLI toward looking better than reality, since a service that reports optimistically and early will systematically override a later, more accurate failure signal from a slower but more authoritative source. It's also worth treating every discovered A/B disagreement as an OPPORTUNITY to fix the underlying instrumentation gap that allowed two services to develop divergent views of the same event in the first place, rather than treating reconciliation as a one-off patch applied after the fact each time a new disagreement surfaces.
Write an algorithm or Python function that computes a rolling error budget burn rate which weights incidents by severity. Inputs: list of incidents with start, end, severity (1-5), total_window_seconds, and SLO_allowed_error_seconds. Output: weighted_burn_rate. Explain your weighting scheme, complexity, and edge cases.
Sample Answer
Weighting incident duration by severity reflects that a short but severe outage can cost more in user trust and support load than a long but minor degradation of the same raw duration.
Structured elaboration
The weighted burn rate sums each incident's duration multiplied by its severity, then divides by the SLO's allowed error-seconds for the window, giving a rate expressed relative to what a "sustainable, unweighted" consumption would look like; a result above 1 means the service is burning budget faster (once severity-weighted) than the SLO's allowance supports. Complexity: the function makes a single pass over the incidents list, doing O(1) work per incident, so time complexity is O(n) where n is the number of incidents; space complexity is O(1) beyond the input list (only a running accumulator is kept, no per-incident storage is allocated).
Worked example (executed; python3, verified against a hand-computed case)
from typing import List, Dict
def weighted_burn_rate(incidents: List[Dict], total_window_seconds: float,
slo_allowed_error_seconds: float) -> float:
weighted_seconds = 0.0
for inc in incidents:
duration = max(0.0, inc['end'] - inc['start'])
weighted_seconds += duration * inc['severity']
if slo_allowed_error_seconds <= 0:
raise ValueError("slo_allowed_error_seconds must be > 0")
return weighted_seconds / slo_allowed_error_seconds
For a 30-day window at a 99.9% SLO, allowed error-seconds is 0.001×30×24×3600=2592 seconds. Two incidents, a 10-minute severity-1 blip (600s) and a 5-minute severity-5 outage (300s), give a severity-weighted total of 600×1+300×5=2100 seconds, so the weighted burn rate is 2100/2592≈0.81, confirmed by running the code; a severity-0 incident (e.g. a data point that turned out not to be a real incident) correctly contributes zero.
Trade-offs and pitfalls
The severity weights themselves are a policy choice, not a measured quantity, and teams disagree about the right multiplier (linear 1-5 versus exponential); whatever scheme is chosen should be documented and applied consistently, because otherwise this number becomes impossible to compare month over month. This function also treats all severity-5 seconds as equally bad regardless of WHEN they occurred (peak traffic vs 3am), which is a real simplification; a more sophisticated version would additionally weight by concurrent request volume, at the cost of needing traffic data alongside the incident list.
Design an enterprise reliability governance model that standardizes SLO ownership, error budget policies, reporting cadence, escalation paths, and incentives across multiple product lines. Include roles (product owner, SRE, engineering manager), required dashboards, and how you would enforce and audit compliance without slowing delivery.
Sample Answer
Enterprise-scale reliability governance needs a genuinely tiered structure, since the same rigid policy applied uniformly across 50 microservices of wildly different criticality either over-constrains the unimportant ones or under-protects the critical ones, and every layer of that structure needs an explicit, named owner and a real audit mechanism.
Structured elaboration
Roles: product owner (owns the business-criticality tier assignment and reporting to leadership), SRE (owns technical SLO measurement and the enforcement mechanism), engineering manager (owns the team's actual remediation work and roadmap trade-offs when budgets burn). Required dashboards: a standard, company-wide reliability dashboard template (current SLO status, burn rate, and tier per service) that every product line adopts, so an executive or auditor can compare services across lines without each team inventing its own bespoke reporting format. Standardized process elements: an explicit SLO-proposal APPROVAL workflow (who can propose a new SLO or change an existing one, and who signs off), a defined escalation and remediation-window procedure for repeated breaches (not just a one-off incident response, but what happens after the SECOND or THIRD consecutive miss), and tiered budget ALLOCATION across services of varying criticality: a concrete 3-tier example assigns critical services a strict policy triggering action at 50% budget consumed, important services at 75%, and best-effort services only at full exhaustion, with corresponding automated or manual actions at each threshold per tier. For a large-scale system (e.g. 50 microservices), budgets need explicit shared-vs-component allocation logic (does a cascading failure across several services draw from one shared pool or each service's own budget) and periodic audits to confirm the allocation still reflects actual current criticality, not a stale assessment from when the service first launched.
Worked example
For a 40-team organization with legal SLAs carrying real financial penalties: the governance model requires any SLO the model designates as SLA-relevant to go through a stricter approval path involving legal, not just engineering sign-off, with a monthly reporting cadence to a cross-functional steering committee (not just the platform team), and an escalation path where two consecutive missed SLOs trigger a mandatory remediation-window review with a defined completion deadline, escalating to executive visibility if the remediation window itself is also missed. Framed as an SLO-driven-development adoption initiative, the model explicitly ties reliability targets back to architecture decisions: a service repeatedly missing its tier's SLO despite remediation attempts should trigger an architecture review, not just another remediation cycle, since repeated tactical fixes failing to hold the target is itself evidence of a structural, not tactical, problem.
Trade-offs and pitfalls
The audit-without-slowing-delivery balance is the hardest part of this design: an overly heavy-handed compliance process (mandatory sign-offs for every minor SLO adjustment) will be quietly worked around by teams under delivery pressure, while an overly light one produces exactly the governance theater problem seen elsewhere, where the framework exists on paper but has no real teeth; the right calibration usually reserves the heaviest process (legal sign-off, executive escalation) for genuinely high-stakes changes (legally-binding SLAs, critical-tier services) while keeping best-effort-tier governance lightweight, so the total compliance burden scales with actual risk rather than being uniform across every tier.
Define and implement SLOs, error budgets, and escalation policies for a data-serving API used by analysts. Include measurable SLIs, how to calculate burn rate, on-call actions when error budget is consumed, and how engineering time should be allocated against the error budget.
Sample Answer
A data-serving API for analysts needs SLOs and an error-budget policy structured the same way a request-serving API's would be, with the escalation and staffing allocation explicitly tuned to an analyst audience's actual usage pattern (often bursty, batch-style queries) rather than assumed to be identical to a typical low-latency consumer API.
Structured elaboration
SLIs: query success rate, p95/p99 query latency (with an explicit acknowledgment that analyst queries have a much wider natural latency distribution than a typical API, since some are trivial lookups and others are large aggregations), and data freshness (how current the underlying data is). Burn rate calculation follows the standard formula, (1−observed SLI)/(1−SLO), computed per SLI. Escalation: on-call actions when budget is consumed should be graduated (a warning-tier notification for moderate burn, requiring investigation but no immediate action; a page for severe or fast burn) with clear ownership (which on-call rotation is responsible for a query-latency regression versus a freshness regression, since these may trace back to different root causes and even different teams). Engineering time allocation: a documented policy for how much of the team's capacity gets reallocated to reliability work as budget burns (e.g. at 50% budget consumed for the month, a fixed percentage of the next sprint shifts to reliability fixes; at full exhaustion, feature work pauses entirely until the budget position recovers).
Worked example
SLO: 99.9% query success over 30 days, p95 latency < 2s (chosen deliberately looser than a typical low-latency API's, reflecting that analysts tolerate longer queries in exchange for richer analytical capability), freshness < 15 minutes. At 50% budget consumed mid-month, the policy allocates 20% of the next sprint to reliability work; at full exhaustion, all new analyst-facing feature work pauses until the team demonstrably stabilizes the underlying issue and the budget position recovers.
Trade-offs and pitfalls
The biggest mismatch risk is copying a typical low-latency API's percentile targets onto an analyst-facing service without adjusting for its genuinely different, often bimodal latency distribution (trivial lookups versus heavy aggregations); a single p95 target across both query shapes can be dominated by whichever type happens to be more common that period, obscuring a real regression in the less-common but still important query type. It's also worth deciding explicitly whether freshness and query-latency degradations should share the SAME error budget or have separate ones, since they often have different root causes and different appropriate engineering responses, and lumping them together can mask which specific problem is actually driving the burn.
Implement a simplified SLO alert evaluator in Python: given a stream or array of sliding-window error rates (one value per minute) and an SLO threshold, trigger an alert if the error rate exceeds the threshold for N consecutive windows. Define function signature, edge-case handling (missing data), and provide example input/output.
Sample Answer
A consecutive-window alert evaluator is a small state machine over a stream of per-minute error rates, and the interesting design decision is what happens to that state when a minute's data is simply missing.
Structured elaboration
The core logic tracks a running streak of consecutive breaching minutes and fires once the streak reaches N; a non-breaching minute resets the streak to zero, which is the ordinary case. The less obvious case is a MISSING minute (no data point at all, as opposed to a zero error rate): treating it as "good" would let a real ongoing breach silently survive a monitoring gap and then resume counting where it left off once data returns, understating how long the breach has actually persisted; treating it as neutral-but-reset (this implementation's choice) is the conservative middle ground, since claiming the streak continued through a data gap you can't observe would itself be an unverifiable assertion.
Worked example (executed; python3, verified against 5 cases including missing data)
from typing import List, Optional
def evaluate_slo_alert(error_rates: List[Optional[float]], threshold: float, n_consecutive: int) -> bool:
streak = 0
for v in error_rates:
if v is None:
streak = 0
continue
if v > threshold:
streak += 1
if streak >= n_consecutive:
return True
else:
streak = 0
return False
Confirmed: [0.01, 0.02, 0.06, 0.07, 0.08] with threshold 0.05 and N=3 correctly returns True (three consecutive breaching minutes at the end); [0.06, 0.07, 0.01, 0.08, 0.09] returns False because the 0.01 minute in the middle resets the streak before it reaches 3; [0.06, None, 0.07, 0.08] returns False because the missing minute resets the streak, so only two consecutive breaching minutes remain after it; an empty input correctly returns False.
Trade-offs and pitfalls
This function only ever looks BACKWARD at a fixed streak; it does not distinguish "three minutes just over threshold" from "three minutes wildly over threshold," which is exactly the gap a burn-rate-based alert (rather than a fixed error-rate threshold) is designed to close. It is also inherently a synchronous, single-pass evaluator: a real streaming deployment needs to decide how state persists across process restarts (an in-memory streak resets to zero on every deploy of the alerting service itself, which could silently delay a real detection right when a release is happening).
Unlock Full Question Bank
Get access to all SLIs, SLOs, SLAs, and Error Budgets interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.