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

Question

Your CI runs jobs many times a day and logs one line per run: "<job> <result>", where result is "pass" or "fail". A job is considered flaky when the SAME job name has at least one "pass" run and at least one "fail" run in the log. A job that always passes, or always fails, is not flaky. Return the flaky job names sorted alphabetically; return an empty list if none qualify.

Implement
flaky_jobs(lines: list[str]) → list[str]
Examples
in[["build pass","test fail","test pass","lint pass"]]out["test"]
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.