Datadog interview question

Tell me your thought process to doing this assignment