Content Delivery Network (CDN) - Interview Questions

What is Content Delivery Network (CDN)?

 key Concept

Content Delivery Network (CDN) is a globally distributed network of servers that serve content from locations closest to the users.

Traditionally CDNs served static content files and pre-generated files such as HTML, CSS, JS, image and images. CDNs have evolved since to now serve dynamic content as well, including rich media.

Content served from CDN significantly improves the performance by reducing latency, since the content is served from servers closest to the users. In addition the load on the servers is also reduced since they do not have to serve content that is served from CDN.

How does a Content Delivery Network (CDN) work?

 key Concept

Content Delivery Network (CDN) stores cached version of content in multiple geographical locations, known as Points of Presence (PoP). Each PoP contains a cluster of cache servers that deliver content to users closest to that geographical region. If the traffic at a particular PoP is high then you can setup more cache servers for that PoP, and if the traffic is low at another PoP then you can setup just one cache server for that PoP.

example, let's consider that a user from London accesses a website hosted in US. Without CDN, the website will take more time to load for the user because of high latency, i.e the request and response has to travel more distance over the network, very likely making multiple hops.

Whereas, with CDN, the same website will take less time to load for the user because of low latency, i.e the request and response has to travel less distance over the network, since the content will be served from a local PoP cache server.

What are the two kinds of CDNs based on how the content is cached and refreshed?

 key Concept

There are two kinds of CDNs based on how the content is cached and refreshed - Push CDNs and Pull CDNs

Push CDNs - In Push CDN model, content is pushed to the CDN cache servers whenever content is modified, or new content is added, on the origin server. Origin server is responsible for pushing the content to the CDN cache servers

Pull CDNs - In Pull CDN model, content is pulled by the CDN from the origin server when that content is first requested by a client. This content is then stored in the cache servers for a certain period of time, usually 1-30 days based on the TTL, so that subsequent requests for that content is served from the CDN cache server.

What are some CDN providers that you are aware of?

 FAQ

Some common CDN providers are Akamai, StackPath, Cloudflare, CDNetwork, Rackspace, Amazon Cloudfront, and Google Cloud CDN

What are the non-functional requirements expected of a CDN system? How does it achieve these requirements?

 FAQ

Following non-functional requirements are expected of a CDN

High Performance

CDNs are expected to improve performance by minimizing latency. This is the core responsibility of a CDN. CDNs achieve high performance by -

  • Serving content from proxy servers nearest to the users through its request routing system.
  • Storing and serving frequently-requested content from RAM of the proxy servers.
  • Storing and serving long-tailed (less frequently requested) content from SSD or HHD of the proxy servers

Availability

CDNs are expected to be highly available. CDNs achieve high availability by -

  • Caching content in proxy servers that act as backup if origin servers go down.
  • Replicating data across multiple proxy servers avoiding a single point of failure.
  • Serving requests from other operational proxy servers if one or more proxy servers go down.

Scalability - CDNs are expected to scale horizontally as the number of users increase. CDNs achieve high scalibility by -

  • Having the ability to scale horizontally by adding additional edge prozy servers as needed.
  • Using layered architecture of proxy servers.
  • Reducing the need for hign bandwidth by bringing content closer to users.

Reliability - CDNs are expected to respond to massive traffic loads reliably and not have single points of failure. CDNs achieve reliability by -

  • Ensuring that there are no single points of failure by adding additional servers, software and maintenance cycles as needed.
  • Using heartbeat protocol to monitor the haelth of servers and take corrective action proactively.

Security - CDNs are expected to provide a layer of protection to hosted content. CDNs achieve security by -

  • Using scrubber servers to identiy malicious traffic and protect against attacks such as DDoS.

 
Subscribe to our Questions

 

System Design - Interview Questions

Components of System Design
 
RECOMMENDED RESOURCES
Behaviorial Interview
Top resource to prepare for behaviorial and situational interview questions.

STAR Interview Example

Resources
Popular resources to prepare for CDN Interview

The Essential CDN Guide