Code Room
CodingEasycod-g1512
Subject Config parsingLevel Entry–Mid~11 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A settings loader logs every assignment it saw as "source key=value": the source word ("default", "file", or "env"), one space, then the assignment (split that part at its first "="; values may contain spaces and "="). The entries arrive in ARBITRARY order, but precedence is fixed: env beats file, file beats default. For a given key, the winner is its highest-precedence entry; among several entries of the same source, the one appearing later in the list wins. Return a dict of each key's winning value.

Implement
effective_settings(entries: list[str]) → dict[str,str]
Examples
in[["default retries=3","env retries=5","file retries=4"]]out{"retries":"5"}
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.