Bold Kiln interview question

asked to complete a task.