Amazon interview question

two coding questions in 60 minutes