0
0
HLDsystem_design~20 mins

CDN concept and usage in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CDN Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does a CDN improve website load times?

Imagine you have a website hosted in one country, but visitors come from all over the world. How does a CDN help make the website load faster for these visitors?

ABy blocking visitors from faraway locations to reduce server load.
BBy compressing the website content only at the origin server before sending it to visitors.
CBy increasing the bandwidth of the origin server to handle more visitors at once.
DBy storing copies of website content in servers closer to visitors, reducing the distance data travels.
Attempts:
2 left
💡 Hint

Think about how distance affects delivery speed of packages in real life.

Architecture
intermediate
2:00remaining
Which component is NOT part of a typical CDN architecture?

Consider the main parts of a CDN system. Which of these is usually NOT included in the CDN architecture?

AUser devices that store permanent copies of website data.
BEdge servers that cache content close to users.
CLoad balancers to distribute traffic among edge servers.
DOrigin servers where the original content is stored.
Attempts:
2 left
💡 Hint

Think about which components the CDN controls versus user devices.

scaling
advanced
2:00remaining
How does a CDN handle sudden traffic spikes to a website?

A popular website suddenly gets a huge number of visitors. How does the CDN help the website handle this spike without crashing?

ABy sending all traffic directly to the origin server to keep edge servers free.
BBy shutting down some edge servers to reduce the number of requests processed.
CBy distributing the traffic load across many edge servers worldwide, preventing overload on the origin server.
DBy limiting the number of visitors allowed to access the website at once.
Attempts:
2 left
💡 Hint

Think about how spreading work among many helpers can prevent one from getting overwhelmed.

tradeoff
advanced
2:00remaining
What is a tradeoff when using a CDN for dynamic content?

CDNs work well for static content like images. What is a common tradeoff when using a CDN to deliver dynamic content that changes often?

ADynamic content may be delayed or outdated because caching can cause stale data to be served.
BUsing a CDN for dynamic content eliminates the need for an origin server.
CDynamic content is always faster because CDNs do not cache it at all.
DDynamic content cannot be encrypted when delivered through a CDN.
Attempts:
2 left
💡 Hint

Think about how caching works and what happens if content changes frequently.

estimation
expert
2:00remaining
Estimate bandwidth savings using a CDN for a global website

A website serves 1 TB of data monthly from its origin server without a CDN. After adding a CDN, 80% of requests are served from edge caches. How much bandwidth does the origin server save monthly?

A1 TB saved, because the CDN handles all traffic now.
B0.8 TB saved, because 80% of data is served from the CDN edges.
C0.2 TB saved, because only 20% of data is served from the CDN edges.
DNo bandwidth saved, because the origin still sends all data.
Attempts:
2 left
💡 Hint

Calculate the percentage of data served by the CDN edges versus the origin.