Pergunta de entrevista da empresa Fidelity Investments

How do you handle a situation when two processes are trying to write to a file at the same time?