RigUp Interview Question

Standard coding exercise...