Datadog Interview Question

Tell me your thought process to doing this assignment