Code Room
CodingEasycod-g1220
Subject Data wranglingLevel Entry–Mid~11 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A teacher's attendance sheet is a day-ordered list of status strings such as "present" or "late", but days the teacher forgot to record are the empty string "". Clean the column by filling forward: replace each missing entry with the most recent recorded status. If the sheet starts with missing days (nothing to carry yet), use `fallback` for those. Example: (["present", "", "late", ""], "absent") gives ["present", "present", "late", "late"].

Implement
fill_forward(log: list[str], fallback: str) → list[str]
Examples
in[["present","","late",""],"absent"]out["present","present","late","late"]
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.