Datadog interview question

2 Algorithm questions