Pregunta de entrevista de Amazon

coding with 1 OOD and 1 algorithm question