Pregunta de entrevista de Meta

some sql question dealing with join func