Amazon Interview Question

some debug questions and logic,coding questions