Amazon interview question

3 leetcode medium and 1 system design