Amazon Interview Question

Technical and STAR question