Datadog interview question

how to write complex quires