Guide / System design Fundamentals
SRE and operations: SLOs, capacity, incidents and cost
SLIs, SLOs and error budgets, burn-rate alerting, capacity planning, incident response and postmortems, on-call health and cost engineering: the senior and staff-level operations topics.
Senior interviews ask how you run systems: how you define “reliable”, decide when to ship vs stabilise, respond to incidents and control cost.
Fundamentals#
O.1 SLI, SLO, SLA and error budgets#
- SLI (indicator): a measured ratio, e.g.
good requests / valid requests, p99 latency under 300 ms. - SLO (objective): a target for an SLI over a window (99.9% of requests succeed in 30 days).
- SLA (agreement): a contractual promise with penalties; always looser than the SLO.
- Error budget =
1 − SLO. 99.9% over 30 days allows ~43 minutes of failure. If the budget is spent, freeze risky releases and fix reliability; if plenty remains, ship faster. This turns “reliability vs features” into a data-driven decision.
| SLO | Downtime per year | per month |
|---|---|---|
| 99% | 3.65 days | 7.3 h |
| 99.9% | 8.8 h | 43.8 min |
| 99.99% | 52.6 min | 4.4 min |
| 99.999% | 5.3 min | 26 s |
Each extra nine costs roughly an order of magnitude more effort; pick per user journey (checkout 99.95%, recommendations 99%). Dependencies cap you: your availability ≤ product of critical dependencies.
O.2 Alerting that works#
- Alert on symptoms users feel (error rate, latency, freshness), not causes (CPU).
- Multi-window burn-rate alerts: page when the budget burns fast (e.g. 14.4× burn over 1 h and 5 min windows = 2% of a 30-day budget in an hour); ticket on slow burns (e.g. 1× over 3 days).
- Every page needs a runbook, an owner and an action; delete alerts that nobody acts on.
- Golden signals: latency, traffic, errors, saturation. RED (rate, errors, duration) for services; USE (utilisation, saturation, errors) for resources.
O.3 Capacity planning#
- Forecast demand (growth, seasonality, launches).
- Measure capacity per unit (load test to the knee of the latency curve).
- Plan headroom (peak ≤ 60–70% of capacity), N+1 or N+2, and lead time for procurement or quota increases.
- Re-test after major changes; track cost per request and utilisation over time.
- Plan for autoscaling lag, cold starts, quotas (cloud limits, DB connections, third-party limits).
O.4 Incident response#
| Phase | Actions |
|---|---|
| Detect | Alerts, user reports; declare an incident early |
| Triage | Severity (SEV1–SEV4), assign incident commander, comms lead, ops lead |
| Mitigate | Stop the bleeding first: roll back, flip a feature flag, fail over, scale, shed load; root cause comes later |
| Communicate | Status page and stakeholder updates on a schedule |
| Resolve | Verify metrics, close |
| Learn | Blameless postmortem within days: timeline, impact, root and contributing causes, what went well/badly, action items with owners and dates |
Good habits: change freezes around big events, a deploy log correlated with graphs, one-click rollbacks, game days, and tracking MTTD/MTTR.
O.5 On-call health and toil#
Sustainable rotations (≥ 6 people, follow-the-sun if possible), page budgets, automation of repetitive work (toil < 50% of time), and blameless culture. Measure pages per shift and after-hours pages.
O.6 Release safety#
Feature flags, canary releases with automated analysis, progressive delivery by region or tenant, database expand/contract migrations, and rollbacks tested regularly (Deployment and release).
O.7 Cost engineering (FinOps)#
- Tag resources by team and service; show cost per request, per tenant, per feature.
- Right-size instances, use autoscaling, spot/preemptible for stateless and batch, reserved/savings plans for steady base load.
- Storage tiering and lifecycle (hot → warm → cold), compression, retention limits for logs and metrics (high-cardinality metrics and verbose logs are common bill shocks).
- Cut data transfer (cross-AZ and cross-region traffic, NAT gateway egress, CDN offload).
- Review the top 10 line items monthly; set budgets and anomaly alerts.
- Trade-off statements: “caching adds Redis cost but removes 3 DB replicas”.
Most asked questions#
1. What are SLIs, SLOs and error budgets? Measured indicator, target over a window, and the allowed failure that governs release pace.
2. How do you decide what to alert on? User-visible symptoms with burn-rate thresholds, each with a runbook; avoid cause-based noise.
3. How do you handle a production incident? Declare, assign roles, mitigate first (rollback/flag/failover), communicate, then root cause and a blameless postmortem with owned action items.
4. How do you plan capacity? Forecast, load test per unit, keep 30–40% headroom and N+1, and monitor utilisation trends.
5. How do you reduce cloud cost? Right-size, autoscale, spot and savings plans, caching/CDN, storage tiering, retention limits and visibility per service.
Senior-level questions#
1. “Product wants a release but the error budget is exhausted.” Policy applies: only reliability work and low-risk fixes ship until the budget recovers; agree this policy in advance with product, and negotiate scope rather than ignore it.
2. “You are paged 20 times a week. Fix it.” Classify alerts: remove non-actionable ones, convert to tickets, automate remediation, fix top causes, add SLO-based alerts, and track toil and page counts as team goals.
3. “How do you set an SLO for a new service?” Start from user journeys, measure for a few weeks, set a target slightly under current performance, review quarterly; one or two SLIs only.
4. “Your cloud bill doubled in two months.” Break down by service and tag, look for new data transfer, log volume, unbounded autoscaling, idle resources, a new feature’s cost per request; fix the top contributors and add guardrails.
5. “Run a postmortem for an outage caused by a config change.” Timeline, contributing factors (no validation, no canary, no rollback), action items (config linting, staged rollout, automatic rollback), and verify they are completed.
Quiz#
1. How much error budget does 99.95% over 30 days give?
0.05% of 43,200 minutes ≈ 21.6 minutes.
2. Why alert on burn rate instead of a fixed error percentage?
It ties paging to how quickly the budget will be exhausted, catching fast burns urgently while ignoring brief blips.
3. What is the first priority in an incident?
Mitigate impact (roll back, flag off, failover), not find the root cause.
4. SLA vs SLO?
SLA is a contractual commitment with consequences; SLO is the internal target, set stricter than the SLA.
5. Name three cost levers.
Right-sizing/autoscaling, spot or committed-use discounts, caching/CDN and data-transfer reduction; also storage tiering and log retention.