Mozilla interview question

Data structures for different scenarios