Amazon interview question

use case