Amazon interview question

Leetcode, OOP. Depends on the interviewer