Razer interview question

How would you join / perform these queries