Amazon Interview Question

How to implement a URL shorten service