Code Room
CodingMediumcod-g1227
Subject Data wranglingLevel Entry–Mid~13 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A gradebook logs retakes as rows "student,subject,score" (score a non-negative integer); the same student-subject pair can appear several times. Produce the flattened grade matrix the report card reads: a dictionary keyed by "student.subject" (the two fields joined with a dot) whose value is that pair's HIGHEST score. Example: ["ava,math,80", "ava,math,92", "raj,art,75"] gives {"ava.math": 92, "raj.art": 75}.

Implement
grade_matrix(rows: list[str]) → dict[str,int]
Examples
in[["ava,math,80","ava,math,92","raj,art,75"]]out{"raj.art":75,"ava.math":92}
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.