Soso interview question

Data strcture