Domanda di colloquio di ThousandEyes

Hard problem and how you solved it