I have to make a system which can give us short version of URL and a way to track clicks.
This gist is about how I solved the first part of problem: as short as possible URL.
First things first. If we talk about system which handle URLs then we should have a table in database.
Example table of URLs: