Loading...

The Link Shrinker

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

A URL shortening service needs to generate a short code from a full URL and store the mapping for later lookup. Given a URL string and a mutable code-to-URL dictionary, generate a 6-character short code using MD5 hashing and store the mapping. Return the short code.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.