Code Room
CodingMediumcod-g1508
Subject Config parsingLevel Entry–Mid~16 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Turn flat dotted settings back into an indented outline for a settings editor. Input lines have the exact shape "dotted.path=value" (split at the first "="; a repeated path keeps its final value). Path segments use lowercase letters, digits, and underscores; no path is also a parent of another. Emit the outline as a list of strings: intermediate segments appear as "name:" and each final segment as "name: value", indented 2 spaces per nesting level. Siblings at every level are ordered alphabetically, and a parent line is printed once before its children. Example: ["app.port=8080"] gives ["app:", " port: 8080"].

Implement
render_config_tree(lines: list[str]) → list[str]
Examples
in[["app.name=api","app.port=8080","debug=false"]]out["app:"," name: api"," port: 8080","debug: false"]
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.