Walmart Interview Question

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