Compass Interview Question

typical coding interviews, each interview was ok but they were too many