Code RoomSlowest request path
EasyPrep Room Coding #498

Slowest request path

CodingAlgorithms & data structuresEntry–Mid~10 min

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.

0:00 of about 10 min
InputExpectedGot
[["/home 120","/checkout 340","/api/items 340"]]"/checkout"not run yetsample