Question d’entretien chez Amazon

Solve this SQL question and the expected results