Design CDN Routing Optimization

Hard45 min
1 / 30
understanding7 min read

Problem Statement and Video CDN Routing Context

Problem Statement and Video CDN Routing Context — video CDN routing interview section.

Problem Statement and Video CDN Routing Context

Netflix/Akamai/Cloudflare interviews ask how you steer HLS/DASH segments to the best edge—not just cache static files. Routing optimizes QoE (segment TTFB, rebuffer) and cost across multi-CDN footprints.

Key points

  • Steering optimizes QoE first, egress cost second, with hard caps per CDN contract.
  • Manifest rewrite is the fastest lever; DNS/Anycast changes follow on slower TTL.
  • RUM closes the loop—without measurement, routing is guesswork.

Deep dive (understanding)

Separate steering control plane (policy, RUM aggregates, GeoDNS maps) from segment data plane (HTTP GET of .ts/.m4s). Players request manifests first; manifest URLs encode which CDN/PoP serves bytes. Open Connect-style private edges change economics but not the routing math.

Capacity and SLO anchors

200M concurrent streams peak, 6s segments → ~33M segment RPS; p95 segment TTFB < 80ms on warm colo; rebuffer ratio < 0.5%.

Failure and degradation (unique to Problem Statement and Video CDN Routing Context)

If a PoP shows elevated segment TTFB for 3 consecutive windows, drain it gradually: halve weight, wait 2 minutes, verify rebuffer SLO, then zero. If manifest API fails, serve last signed snapshot from regional cache—never block playback on control-plane outage.

Cost and multi-CDN lens

Weighted steering respects per-CDN max share (e.g., premium network ≤30%). Shifting 1% of 200 Tbps saves millions monthly—tie routing to finance dashboards, not only QoE.

Security and abuse

Sign manifests; rate-limit RUM ingest; validate session HMAC to prevent score poisoning. TLS terminates at edge; colo IDs must not leak internal topology in client-visible errors.

javaOne Dark Pro
1public final class ColoScore {
2 private final String popId;
3 private final double rumP95Ms;
4 private final double capacityHeadroom;
5
6 public double weightedScore(double wLatency, double wCapacity) {
7 return wLatency * (1000.0 / Math.max(rumP95Ms, 1.0)) + wCapacity * capacityHeadroom;
8 }
9}
pythonOne Dark Pro
1from dataclasses import dataclass
2
3@dataclass(frozen=True)
4class RumSample:
5 pop_id: str
6 segment_ttfb_ms: int
7 rebuffer: bool
8
9def ewma(prev: float, sample: float, alpha: float = 0.2) -> float:
10 return alpha * sample + (1 - alpha) * prev
typescriptOne Dark Pro
1interface SteeringPolicy {
2 version: number;
3 cdns: { id: string; weight: number; maxShare: number }[];
4 rumMinSamples: number;
5}
6
7export function pickCdn(policy: SteeringPolicy, scores: Record<string, number>): string {
8 const ranked = Object.entries(scores).sort((a, b) => b[1] - a[1]);
9 return ranked[0]?.[0] ?? policy.cdns[0].id;
10}

Why interviewers care

CDN Routing Optimization interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement and Video CDN Routing Context that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Netflix/Akamai/Cloudflare interviews ask how you steer HLS/DASH segments to the best edge—
  • Separate **steering control plane** (policy, RUM aggregates, GeoDNS maps) from **segment d
  • Close the RUM feedback loop with hysteresis and CDN caps.
Say this clearly
For Problem Statement and Video CDN Routing Context, quantify segment RPS and explain manifest-first steering.
Avoid
Treating video routing like static CDN caching without RUM or multi-CDN caps.

Section Rescue Kit

Buzzwords to use:

RUM steeringManifest rewrite

Safe statements:

  • "I separate steering control plane from segment bytes on the whiteboard."
  • "Multi-CDN weights use caps—QoE cannot violate commercial egress deals."
  • "Drains are layered: manifest, API, then DNS—never one lever alone."
Design CDN Routing Optimization - System Design | WinJob | WinJob