What is a CDN (Content Delivery Network)?

Why Interviewers Ask This

This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex System Design topics. It also reveals how well you can explain technical ideas to non-experts.

Answer

A CDN is a globally distributed network of servers (edge nodes/PoPs — Points of Presence) that cache and deliver content from locations geographically closer to users, reducing latency and origin server load. How it works: when a user requests content, the CDN routes the request to the nearest edge server (based on DNS routing or Anycast). If the edge has the cached content, it serves it directly (cache hit). If not (cache miss), it fetches from the origin, caches it, and serves the user. Content served via CDN: static assets (images, CSS, JS, fonts, videos), large files, streaming media, and increasingly dynamic content (edge computing). Benefits: reduced latency (content served from nearby node), reduced origin server load (most requests served by CDN), improved availability (distribute traffic across many nodes), DDoS protection (distributed absorbs attack traffic), SSL termination at edge. Cache control: CDN respects Cache-Control and Expires HTTP headers set by the origin. Invalidation: purge specific files or paths via CDN API. Providers: Cloudflare, AWS CloudFront, Akamai, Fastly, Azure CDN. Cache-Control headers: Cache-Control: public, max-age=31536000 — cache for 1 year (immutable assets with hash in filename); Cache-Control: no-store — don't cache at all (sensitive data). CDN is usually one of the highest-impact, lowest-effort performance improvements for any web application.

Pro Tip

Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex System Design answers easy to follow.