Genpact interview question

SQL query on joins