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

Question

An app loads its settings from a base file and then an environment overlay, each given as a list of lines. In both files: trim the line; discard it when empty or when it begins with "#"; otherwise split at the first "=" and trim key and value. Combine the two into one dict where every overlay entry replaces the base entry with the same key, and inside a single file a repeated key keeps its final assignment. An override to an empty value still counts as an override. Return the combined dict.

Implement
apply_overrides(base: list[str], overlay: list[str]) → dict[str,str]
Examples
in[["retries=3","log_level=info"],["log_level=debug"]]out{"retries":"3","log_level":"debug"}
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.