Genpact Interview Question

SQL query on joins