Prudential interview question

Explain your methodology for solving the programming problem.