Pregunta de entrevista de Oracle

Typical puzzle problems you find online, and one data structure coding problem