Code Room
Code reviewHardcr-g385
Subject LifetimesLevel Senior–Staff~24 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this C++ function returning a view over the parsed tokens.

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
std::span<const Token> parse(std::string_view input) {    std::vector<Token> toks = tokenize(input);    return std::span<const Token>(toks);   // hand back a view} auto view = parse(src);for (const Token& t : view) { process(t); }
Run or narrate your approach, then ask the coach.