Walmart interview question

Design an algorithm that traverses through the 4 points of a rectangle