the LEGO Group interview question

After the code walk-through, they asked me what would I do to refactor the code