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

Question

A service refuses to boot unless certain settings exist. You get the config file as lines plus the list of required setting names (all distinct). Parse the lines: trim each; ignore empty ones and ones starting with "#"; split the rest at the first "=" with key and value trimmed; a name assigned several times keeps its last value. A requirement is satisfied only when the name was assigned AND its final value is non-empty after trimming. Return the unsatisfied names sorted alphabetically. Example: lines ["port=8080", "host="] with required ["port", "host"] returns ["host"].

Implement
missing_settings(lines: list[str], required: list[str]) → list[str]
Examples
in[["port=8080","host="],["port","host","token"]]out["host","token"]
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.