AllMediaDesk interview question

First round: Algorithms! Second round: Tech interview