Datadog interview question

A coding exercice to solve and to discuss.