Code Room
Code reviewHard
Question
Review this Python routine that writes a file only if it doesn't already exist.
Under concurrent callers (threads or processes), what breaks?
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
import os def write_once(path, data): if not os.path.exists(path): # (1) check with open(path, 'w') as f: # (2) use f.write(data) return True return False # already existedRun or narrate your approach, then ask the coach.