Code Room
Code reviewHard
Question
Review this Python scheduler loop.
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
def run_tasks(tasks): # tasks: list of (priority, job); lower priority runs first results = [] while tasks: tasks.sort(key=lambda t: t[0]) # find next task priority, job = tasks.pop(0) results.append(execute(job)) tasks.extend(spawn_children(job)) # jobs can enqueue more jobs return resultsRun or narrate your approach, then ask the coach.