# Boxes Inside Boxes

Boxes Inside Boxes: Composite: Boxes Inside Boxes.

Updated: November 17, 2026

1. [Composite: Boxes Inside Boxes](https://www.ask-codey.com/lessons/dp-composite) (Journeyman): When the tracker weighs a shipment by asking every item "are you a box or a pallet?", it needs one more nested loop for every level of pallets, and a pallet on a pallet on a pallet gets missed; with the Composite pattern, a box and a pallet answer the same question, and a pallet answers by asking what's on it.

Source: https://www.ask-codey.com/courses/design-patterns/topics/dp-boxes-inside-boxes
