Samsung Electronics interview question

What is the use of dynamic programming?