Pregunta de entrevista de Binance

How do you construct a tree in typescript