0
0
HLDsystem_design~10 mins

First design walkthrough (URL shortener) 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 identify the main component responsible for generating short URLs.

HLD
The core component that generates the short URL is called the [1] service.
Drag options to blanks, or click blank then click option'
ALoad Balancer
BURL Resolver
CURL Shortening
DDatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the URL Resolver with the URL Shortening service.
Thinking the database generates the short URL.
2fill in blank
medium

Complete the code to describe the key-value store used for mapping short URLs to original URLs.

HLD
The system uses a [1] to store the mapping between short URLs and original URLs for fast lookup.
Drag options to blanks, or click blank then click option'
Arelational database
Bkey-value store
Cfile system
Dmessage queue
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing relational database which is slower for simple key lookups.
Choosing message queue which is for asynchronous processing.
3fill in blank
hard

Fix the error in the request flow description for redirecting short URLs.

HLD
When a user clicks a short URL, the system [1] the original URL from the database and redirects the user.
Drag options to blanks, or click blank then click option'
Areads
Bdeletes
Cwrites
Dupdates
Attempts:
3 left
💡 Hint
Common Mistakes
Thinking the system writes or updates during redirect.
Confusing read with delete operation.
4fill in blank
hard

Fill both blanks to complete the description of the short URL generation logic.

HLD
To generate a unique short URL, the system uses a [1] to create a unique ID and then [2] it into a short string.
Drag options to blanks, or click blank then click option'
Acounter
Bhashes
Cdatabase
Dencodes
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hashes' instead of 'encodes' for the second blank.
Using 'database' instead of 'counter' for the first blank.
5fill in blank
hard

Fill all three blanks to complete the description of scaling the URL shortener system.

HLD
To handle high traffic, the system uses a [1] to distribute requests, multiple [2] for storage, and [3] caching to speed up lookups.
Drag options to blanks, or click blank then click option'
Aload balancer
Bdatabases
Cin-memory
Dsingle server
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'single server' which does not scale well.
Confusing caching with database storage.