Datadog interview question

not leetcode style more like concept implementation