To analyze a production system and find its best configuration, the technique of simulation-based optimization is often utilized. This paper describes a practical exercise used at the University of Skövde, Sweden to teach simulation-based optimization to students using a physical Lego factory. The Lego factory provides a setting that is close to reality, and optimizing its production assists students to deepen their understanding of simulation-based optimization.