WD interview question

How did you implement the question