Amazon interview question

The algorithms.