Mastercard interview question

Core java