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

Question

A latency log records one completed request per line as "<path> <latency_ms>", for example "/checkout 340", with latency as a non-negative integer. Given at least one line, return the path of the slowest request. If several requests share the maximum latency, return the path of the one that was logged earliest. The same path may appear on many lines; each line counts as its own request.

Implement
slowest_request(lines: list[str]) → str
Examples
in[["/home 120","/checkout 340","/api/items 340"]]out"/checkout"
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.