Amazon interview question

OOP for python and optimisation