Pregunta de entrevista de Virtusa

Question on Collections in Java and some SQL query.