ThousandEyes Interview Question

Coding challenge.