Design a content delivery network (CDN).
Clarify which content it serves, where its users are, how often content changes, and what access-control and freshness guarantees are required. Then describe the request path, cache behavior, origin interaction, and recovery from failures. State any scale or workload assumptions rather than treating them as given.
### What a Strong Answer Covers
- Request routing to an edge location and the path for cache hits, misses, and stale content.
- Correct cache keys, freshness rules, content updates, and separation of public and user-specific responses.
- Protection of the origin when many requests miss the cache or an edge location fails.
- A practical plan for configuration rollout, invalidation, capacity, and observability.
### Follow-up Questions
- How would you prevent a newly popular object from causing thousands of simultaneous origin fetches?
- What guarantee can an invalidation operation provide across many edge locations and downstream browser caches?
Overview: Design a CDN with edge routing, correct cache keys and freshness, safe content updates, origin protection, failure recovery, and observable cache behavior.
Clarify which content it serves, where its users are, how often content changes, and what access-control and freshness guarantees are required. Then describe the request path, cache behavior, origin interaction, and recovery from failures. State any scale or workload assumptions rather than treating them as given.
What a Strong Answer Covers Guidance
Request routing to an edge location and the path for cache hits, misses, and stale content.
Correct cache keys, freshness rules, content updates, and separation of public and user-specific responses.
Protection of the origin when many requests miss the cache or an edge location fails.
A practical plan for configuration rollout, invalidation, capacity, and observability.
Follow-up Questions Guidance
How would you prevent a newly popular object from causing thousands of simultaneous origin fetches?
What guarantee can an invalidation operation provide across many edge locations and downstream browser caches?