Code Room
Code reviewHard
Question
Review this Python function that prunes archived items from an in-memory list. Profiling shows it dominates a nightly job when the list has hundreds of thousands of items.
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 prune_archived(items): for item in list(items): if item.archived: items.remove(item) return itemsRun or narrate your approach, then ask the coach.