0
0
HLDsystem_design~20 mins

CDN caching for static content in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CDN Caching Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does a CDN improve performance for static content?

Imagine you have a website serving images and CSS files globally. How does using a CDN help improve the loading speed for users?

ABy requiring users to download all content from the origin server directly.
BBy compressing files on the origin server before sending to users.
CBy dynamically generating static content on each user request.
DBy storing copies of static files closer to users in multiple locations worldwide.
Attempts:
2 left
💡 Hint

Think about how distance affects loading times and where files are stored.

Architecture
intermediate
2:00remaining
Which component is responsible for cache invalidation in a CDN setup?

In a CDN architecture for static content, which part typically handles cache invalidation when content updates?

ACDN edge servers automatically detect changes without any signals.
BThe origin server sends cache purge requests to CDN edge servers.
CUsers manually clear their browser cache to update content.
DDNS servers update cache entries for static files.
Attempts:
2 left
💡 Hint

Consider who controls the original content and how updates propagate.

scaling
advanced
2:00remaining
What is the main benefit of using a CDN for scaling static content delivery during traffic spikes?

Your website experiences sudden high traffic. How does a CDN help handle this increased load for static files?

ABy increasing the origin server's CPU and memory automatically.
BBy storing static content only on the origin server to avoid duplication.
CBy distributing requests across many edge servers, reducing load on the origin server.
DBy blocking excess user requests to limit traffic.
Attempts:
2 left
💡 Hint

Think about how spreading work helps handle more users.

tradeoff
advanced
2:00remaining
What is a tradeoff when setting a very long cache expiration time for static content in a CDN?

Setting a long cache expiration time improves performance but what is a potential downside?

AUsers may see outdated content if the origin updates but CDN cache is not refreshed.
BThe CDN will consume more bandwidth from the origin server.
CThe origin server will have to handle more requests directly.
DStatic content will load slower for users globally.
Attempts:
2 left
💡 Hint

Think about content freshness versus speed.

estimation
expert
3:00remaining
Estimate the bandwidth savings when using a CDN caching 90% of static content requests for a website serving 1TB/month of static files.

Your website serves 1TB of static files monthly. If the CDN cache hit ratio is 90%, how much bandwidth is saved on the origin server?

A900 GB saved, only 100 GB served by origin.
B100 GB saved, 900 GB served by origin.
C1 TB saved, origin serves 0 GB.
DNo bandwidth saved, origin serves full 1 TB.
Attempts:
2 left
💡 Hint

Calculate based on percentage of requests served by CDN cache.