Morgan Stanley Interview Question

a design question based on decorator pattern