CSE Roadmap

Core tier · about 6 hours · 13 parts

Part 2 of 13 · 2 min read

State numeric targets before drawing a single box

An architecture diagram with no numbers attached to it cannot be judged as better or worse than any other.

Think of a building contract with no specified square footage, budget or deadline. Any building the contractor puts up technically satisfies it, because nothing was actually promised.

In plain words: a service-level objective is a numeric target for the system — a p95 latency ceiling, a cost ceiling, an availability floor, a quality floor. Stating these four numbers before drawing any architecture gives you something concrete to check every later design choice against, rather than a vague sense of "better" or "worse."

A worked example. The fictional support-agent design is checked against p95 ≤ 8s, cost ≤ $0.02, availability ≥ 99.5%, and quality ≥ 0.80. Against those targets, the model-only baseline misses nothing. Adding a router to cut cost makes the design miss quality (0.78 against 0.80). Adding the agent loop makes it miss both latency and quality. Each box's cost is now visible against a concrete number, not a feeling.

The key lines. From code/mini-sysdesign/budget.py:

# from code/mini-sysdesign/budget.py
@dataclass
class SLO:
    p95: float
    cost: float
    availability: float


def check(summary, slo, quality=None, min_quality=None):
    """Which targets does the design miss?"""
    miss = []
    if summary["p95"] > slo.p95: miss.append("latency")
    if summary["mean_cost"] > slo.cost: miss.append("cost")
    if summary["availability"] < slo.availability: miss.append("availability")
    if quality is not None and min_quality is not None and quality < min_quality: miss.append("quality")
    return miss

Read it as: check compares a design's measured summary against the slo on four independent axes and returns exactly which ones failed. It never collapses the four into one score. A design that's cheap but slow and a design that's fast but low-quality are both failing, just on different axes, and an interviewer wants to hear you name which one.

Service-level objective (SLO)

An SLO is a numeric target for the system, such as p95 latency at most 8 seconds, cost at most $0.02 per request, availability at least 99.5%, quality at least 0.80.

Example: the router dropping assumed quality from 0.84 to 0.78 only becomes a finding because 0.80 was stated as the SLO beforehand. Without that number, "0.78" is just a number with no verdict attached.