Qualcomm interview question

Complex joining queries using sql.