Broadridge interview question

Some white board coding. Not too hard