S&P Global interview question

Simple programming questions