Citi Interview Question

how to handle race conditions in python