Nuvalence interview question

Had to implement object flattening on multiple layers