Generate bronze datasets (transactions, stores, customers) for a retail scenario, introduce data quality issues (such as nulls and casing inconsistencies), transform them into a silver layer, build an aggregate gold view, and construct analysis/EDA notebooks using Genie Code.
Asked in the Vibe Coding Round stage. The interviewer evaluated prompting Databricks Genie Code, inspecting generated code, and transforming records across Medallion architecture layers.
Implement build_retail_layers(transactions, stores, customers). Each argument is a list of dictionaries. Return a dictionary containing cleaned silver records, store-level gold aggregates, and deterministic eda summaries. Normalize identifiers, discard invalid or unreferenced transactions, deduplicate transaction IDs, and report the resulting counts.
def build_retail_layers(transactions, stores, customers):