Code Room
Code reviewMediumcr-g070
Subject Unnecessary allocationLevel Mid–Senior~20 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Review this Java CSV exporter.

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 reviewjava
public String toCsv(List<Record> records) {    String out = "id,name,amount\n";    for (Record r : records) {        out += r.getId() + ","             + r.getName() + ","             + r.getAmount() + "\n";    }    return out;} public void writeExport(List<Record> records, Path file) throws IOException {    Files.writeString(file, toCsv(records));}
Run or narrate your approach, then ask the coach.