Pregunta de entrevista de IBM

Basic SQL question. And one data structure question.