Grafana Labs interview question

leet code medium level of question