Databricks interview question

Simple coding question, no fancy algorithms.