Paystone interview question

Coding test to test logical thinking