Code Room
Code reviewHard
Question
Review this C++ lazy singleton meant to be thread-safe.
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
static Logger* instance = nullptr;static std::mutex initMu; Logger* getLogger() { if (instance == nullptr) { std::lock_guard<std::mutex> g(initMu); if (instance == nullptr) { instance = new Logger(); // construct then publish } } return instance;}Run or narrate your approach, then ask the coach.