There's a log file of tens of gigabytes; each line contains, separated by spaces, the timestamp, method, path, status, and response time in milliseconds. Write a function top_error_paths that takes the file path and a number k and returns the k paths with the most 5xx responses, along with how many malformed lines were skipped.
~15 min by voice
How to approach it
They're checking whether you can process a file that doesn't fit in memory: read it as a stream, robustly against garbage in the data, with memory that depends on the number of keys rather than the size of the input. Plus carefulness: exact 5xx filtering, counting malformed lines, clarifying requirements before coding.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.