XYZ Interview Question

Write sql query for joins