ServiceNow Interview Question

Easy algorithms. They don't care a lot about syntax