Domanda di colloquio di Walmart

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