Amazon interview question

two coding questions and ur previous project questions