dynamic programming interview