Databricks Performance Tuning, Workflows, and MLflow Interview Questions and Answers

Senior Databricks interviews dive deep into Spark performance optimization, orchestration, and MLOps. Here are key Databricks tuning, Workflows, and MLflow interview questions and answers.

1. How do you diagnose and fix Data Skew in Spark on Databricks?

Answer: Data skew appears when one Spark task runs far longer than others due to uneven key distribution. Enable Adaptive Query Execution (AQE) skew join optimization (spark.sql.adaptive.skewJoin.enabled), filter out null/skewed keys before joins, or apply key salting.

2. When does Spark use a Broadcast Hash Join vs. a Sort Merge Join?

Answer: When one table is small enough to fit in driver/executor memory (under spark.sql.autoBroadcastJoinThreshold, or hinted with broadcast(df)), Spark broadcasts it to every executor to avoid shuffling the large table. For two large tables, Spark defaults to a Sort Merge Join (or Shuffle Hash Join under Photon).

3. What is Adaptive Query Execution (AQE)?

Answer: AQE dynamically re-optimizes query execution plans at runtime using real shuffle statistics—coalescing tiny post-shuffle partitions, switching Sort Merge Joins to Broadcast Joins when filtered tables turn out small, and splitting skewed partitions automatically.

4. What are the advantages of Databricks Workflows and Serverless Compute?

Answer: Databricks Workflows orchestrate notebooks, Python scripts, SQL tasks, and DLT pipelines with conditional branching, retries, and repair-and-rerun capabilities. Serverless Compute eliminates cluster spin-up delays and manual VM sizing with instant scaling and automatic patching.

5. How does MLflow integrate with Unity Catalog?

Answer: MLflow tracks experiments, parameters, metrics, and artifacts during model training, while the Unity Catalog Model Registry governs production models across workspaces with aliases (such as @champion), lineage back to training tables, and RBAC permissions.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top