BairesDev interview question

Solve a data structure problem targeted at Typescript and nodeJS internal workings,