Jump to content

Programming Challenge: URL Shortener Checker (Jan 7, 2025)

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! 😊

  • Views 135
  • Created
  • Last Reply

Create an account or sign in to comment

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.