Domanda di colloquio di Meta

complicated sql questions which I cannot solve immediately