Amazon interview question

Two easy leetcode questions. One BQ and one system design.