JDRF Electromag interview question

What is dynamic programming? Use an example.