Prudential Interview Question

Explain your methodology for solving the programming problem.