Prudential interview question

A coding challenge asking me to implement some DSA.