Datadog Interview Question

how to write complex quires