Pregunta de entrevista de Condé Nast

basic sorting code in python and advanced sql quesitons