Pregunta de entrevista de Oracle

Coding question based on OOD.