Virgin Gates interview question

How can we use this design pattern to solve this problem ?