Amazon interview question

How to implement a URL shorten service