Genpact Interview Question

self join and subquery