Cognizant interview question

Write a inner join sql query for a logic