Grokking the System Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
Krish
Solving Hash Collision for URLs

Krish

Aug 14, 2023

The idea to use md5 hash in the first place was to have a unique values with very low collision for urls. So when we are actually using the first 6/7 chars of the base64 encoded version of this hash, theoretically there's a good chance of the key collision with the first 6/7 chars. In case of the collsion for 2 urls (having the same first 6 chars), what is the best way to generate a unique key?

0

0

Comments
Comments
S
Sid a year ago

They mention swapping out chars in case of collision.

On this page

  1. Why do we need URL shortening?

Try it yourself

Designing URL Shortener (video)

  1. Requirements and Goals of the System
  1. Capacity Estimation and Constraints
  1. System Interface Definition
  1. Create Short URL API
  1. Redirect API
  1. Analytics API
  1. URL Management API
  1. Delete Short URL API
  1. Database Design
  1. Basic System Design and Algorithm

a. Encoding actual URL

b. Generating keys offline

  1. Data Partitioning and Replication
  1. Cache
  1. Load Balancer (LB)
  1. Purging or DB cleanup
  1. Telemetry
  1. Security and Permissions