Mastercard interview question

he asked me some queries to write