Wayfair interview question

Balanced brackets question, Different joins in SQL