HubSpot interview question

Solve this problem using callbacks Sort a list