Revolut interview question

Simple multithreading problem (programming task),