Revolut interview question

2. How to ensure thread safety in this method