Amazon interview question

How does gradient descent work?