LTM Limited interview question

Sql and dsa basic question