Pregunta de entrevista de SELLinALL

Java Programming and logic question