ServiceNow interview question

basic algorithm question, some question on REST