Design a Content Delivery Network like CloudFlare or Akamai that accelerates static content delivery (images, videos, JavaScript, CSS) to users worldwide. The CDN operates 200+ edge locations (Points of Presence), serves 10 million requests per second globally, and must deliver content from the nearest edge with sub-50ms latency for cache hits. The CDN serves content for 100,000 customer websites.
In your 90-second answer, cover: - How users are routed to the nearest edge server (DNS and network-level routing) - Cache hierarchy: what happens on a cache hit vs. miss at the edge - Cache invalidation: how customers purge outdated content from all 200+ edges - Origin shielding: how the CDN protects customer origin servers from traffic spikes
Constraints: cache invalidation must propagate to all edges within 30 seconds. The CDN must handle origin server failures gracefully (serve stale content rather than errors).
How to approach it
- Hint 1
Users reach the nearest edge via two complementary mechanisms: (1) GeoDNS resolves the CDN hostname to the IP of the nearest edge cluster based on the client's location, and (2) Anycast routing -- multiple edge locations advertise the same IP address, and BGP routing naturally directs packets to the nearest one based on network topology.
- Hint 2
A cache miss at the edge should not go directly to the customer's origin server. Use a multi-tier cache hierarchy: edge (L1) -> regional shield (L2) -> origin. The shield layer collapses multiple edge misses into a single origin request, protecting the origin from being overwhelmed.
- Hint 3
For cache invalidation, push a purge command to all edge locations via an internal message bus (Kafka or a gossip protocol). Each edge receives the purge, marks the content as invalid, and either deletes it or serves it stale while fetching a fresh copy.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.