Amazon interview question

Numerical optimization problem with one-dimensional data