educative.io

Educative

TinyURL - Why "Multiple users enter the same URL, they can get the same short URL, which is NOT acceptable"

The title was a quote from the original course text. Why same URL → same short URL is not acceptable? High doubt this is a typo.

Hi @Michael_Educative

In the same lesson, the functional requirements of the system are mentioned under the heading Requirements and Goals of the System. It is mentioned there that:
( Links will expire after a standard default timespan. Users should be able to specify the expiration time)
So keeping this requirement in mind, we cannot give the same tiny URL to multiple users who enter the same URL. Because if we do so, there would be a conflict in the expiry date for multiple users.

Yes, there could be some URL shortening service that doesn’t have an expiration date, then the scenario would be different. But the proposed solution in the lesson has expiration as a functional requirement.
Hope you get it. Happy learning :slight_smile:

5 Likes

Thank you! Your explanation makes a lot of sense.

Just to add to you thoughts.
If I’m thinking right, if we want to add additional features like statistics of a shortened URL based on user, it would be more suitable if different tiny URLs are returned for different users.