Bird
Raised Fist0
HLDsystem_design~10 mins

Media storage and CDN in HLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the primary storage type for media files.

HLD
media_storage = [1]
Drag options to blanks, or click blank then click option'
AObjectStorage
BMessageQueue
CInMemoryCache
DRelationalDatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing relational databases which are not optimized for large binary files.
Using in-memory cache which is volatile and limited in size.
2fill in blank
medium

Complete the code to define the CDN component responsible for caching media content.

HLD
cdn_cache = [1]
Drag options to blanks, or click blank then click option'
AEdgeServer
BLoadBalancer
CDatabaseReplica
DMessageBroker
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing load balancers with caching servers.
Using database replicas which do not serve cached media content.
3fill in blank
hard

Fix the error in the request flow to ensure media requests are routed to the nearest CDN node.

HLD
user_request -> [1] -> origin_server
Drag options to blanks, or click blank then click option'
ALoadBalancer
BMessageQueue
CEdgeServer
DDatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Routing requests directly to the origin server causing higher latency.
Using load balancers which do not cache content.
4fill in blank
hard

Fill both blanks to complete the media upload flow with caching and storage.

HLD
upload_request -> [1] -> [2] -> confirmation
Drag options to blanks, or click blank then click option'
AOriginServer
BEdgeServer
CObjectStorage
DLoadBalancer
Attempts:
3 left
💡 Hint
Common Mistakes
Sending uploads directly to edge servers which are for caching, not storage.
Skipping load balancer causing uneven request distribution.
5fill in blank
hard

Fill all three blanks to define a dictionary mapping media types to their CDN cache policies.

HLD
cache_policies = {"image": [1], "video": [2], "audio": [3]
Drag options to blanks, or click blank then click option'
A"short_ttl"
B"long_ttl"
C"medium_ttl"
D"no_cache"
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning no_cache to all media types causing poor performance.
Using short TTL for videos leading to frequent cache misses.