Vista interview question

Design a solution for this coding problem