Databricks Interview Question

LC related to tagged q pattern