Datadog Interview Question

Very easy coding questions, I don't see there are algorithms