Uber Interview Question

They gave me tables i/p and o/p and asked to write SQL query