Agoda interview question

Reverse a list, create certain data structure