Your assignment is to implement a URL shortening service.
ShortLink is a URL shortening service where you enter a URL such as https://yello.co/directory1/directory2/resource and it returns a short URL such as https://short.est/GeAi9K.
- Implement the assignment using:
- Language: Python
- Framework: Your choice, Django, Flask or any other you prefer. Framework is optional, not required.
- Two endpoints are required:
- /encode - Encodes a URL to a shortened URL
- /decode - Decodes a shortened URL to its original URL.
- Both endpoints should return a JSON response.
- There is no restriction on how your encode/decode algorithm should work. You need to ensure that a URL can be encoded to a short URL and the short URL can be decoded to the original URL. You can persist the short URLs and Long URLs in a database, but it's optional.
- Add authentication and authorization to ensure that only authenticated users can use the service to encode URLs.
- Coding Language best practices
- API implemented featuring an
/encode
and/decode
endpoint - Show us your work through your commit history
- Completeness: Did you complete the features? Are you able to demonstrate that?
- Correctness: Does the functionality act in sensible, thought-out ways?
- Maintainability: Is it written in a clean, maintainable way?
- Use of AI: You are expected to be able to showcase, explain and iterate over your code. AI usage is allowed as a programming aide, but do not simply copy/paste AI-generated code.
It doesn’t have to be perfect. Writing code always involves trade-offs and design decisions. The most important thing is your ability to speak about the decisions you have made.
- Please submit your code in a new GitHub repository. You can start by forking this repository into your account and then create a clone of it locally.