AMS interview question

Motivation