Bain & Company interview question

trickyy queries, joins etcc