Question d’entretien chez Tencent

SQL question and one basic algorithm that needs to be fully written in python.