Oracle interview question

Coding question based on OOD.