Jump to content

Featured Replies

Posted

Build a URL shortener that converts a long URL into a short one and allows users to retrieve the original URL from the shortened version.

Basic Requirements:

  1. Accept a long URL as input and return a shortened URL.
  2. Store the mapping between the long and short URLs.
  3. Accept a shortened URL as input and return the original long URL.

Bonus Features:

  • Use a hashing algorithm to generate the short URL.
  • Add error handling to check if the input URL is valid.
  • Implement file-based persistence so the mapping is saved between runs.

Example Output:

Enter a long URL: https://codenamejessica.com/forums/forum/9-programming-challenges
Short URL: https://short.ly/abcd1234

Enter a short URL: https://short.ly/abcd1234
Original URL: https://codenamejessica.com/forums/forum/9-programming-challenges

This challenge helps with string manipulation, data storage, and URL validation — a fun and practical project! 😊

CodeName: Jessica

💻 Linux Enthusiast | 🌍 Adventurer | 🦄 Unicorn 
🌐 My Site | 📢 Join the Forum

spacer.png

 

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.