Code Room
Code reviewHard
Question
Review this C++ loop that prunes expired entries.
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
#include <map>#include <cstdint> void prune(std::map<int, uint64_t>& sessions, uint64_t now) { for (auto it = sessions.begin(); it != sessions.end(); ++it) { if (it->second < now) { sessions.erase(it); } }}Run or narrate your approach, then ask the coach.