Visa Inc. interview question

Pseudo code questions which was kinda basic