Code Room
CodingEasycod-g1322
Subject Log processingLevel Entry–Mid~10 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A crash-reporting service stores one line per crash as "<device_model> <os_version>", for example "pixel8 14". Product wants to know which device model is generating the most crash reports. Given at least one line, return the model with the highest number of reports; if several models tie, return the alphabetically smallest model name. The OS version is irrelevant to the count — every line is one crash for its model.

Implement
crashiest_model(lines: list[str]) → str
Examples
in[["pixel8 14","iphone15 17","pixel8 15"]]out"pixel8"
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.