design pattern exercises