Code Room
Code reviewHardcr-g064
Subject Sign errorsLevel Senior–Staff~25 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this C++ loop that iterates a vector backward from the last element to the first.

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.

Talk through your review
Code to reviewcpp
void printReverse(const std::vector<int>& v) {    for (size_t i = v.size() - 1; i >= 0; i--) {        std::cout << v[i] << "\n";    }}
Run or narrate your approach, then ask the coach.