Amazon interview question

1. Binary search 2. Tiny URL