Amazon Interview Question

Principle questions with star methods