Morgan Stanley interview question

a design question based on decorator pattern