Amazon interview question

Threat model , code review