Carousell interview question

SQL question to write query with joins