Check array length before looping. Frame the concept in practical terms so you can explain it during interview discussion.
Before starting a loop, checking if an array is empty prevents errors like accessing non-existent elements. In a shopping cart, this check ensures you don't try to sum prices when there are no items.