Databricks interviews for data engineers and platform roles go past notebook basics into how Spark actually runs a job, what Delta Lake adds, how governance works with Unity Catalog, and how you keep pipelines fast and affordable. The questions below are the ones that come up most, each with what the interviewer is testing, an answer frame and a short spoken answer.
Spark: the open-source distributed compute engine for batch, streaming, SQL and ML.
Databricks: a managed platform built around Spark by its original creators; adds managed clusters, Delta Lake, Unity Catalog, notebooks, jobs, SQL warehouses and MLflow, on the major clouds.
Relationship: Databricks runs an optimised Spark runtime plus its own engine work, such as Photon.
"Spark is the open-source engine that distributes computation across a cluster. Databricks is the managed platform around it, created by the same people: it provisions and scales clusters, adds the Delta Lake storage layer, governance through Unity Catalog, collaborative notebooks, job orchestration, SQL warehouses and MLflow, and runs on the main cloud providers. So Spark is the engine; Databricks is the car built around it."
Using the two names interchangeably.
Data lake: cheap object storage, open file formats, any data shape; weak on transactions, quality and performance.
Warehouse: transactions, schemas, governance, fast SQL; expensive and closed to unstructured data.
Lakehouse: keep data in open formats on object storage and add a transactional table layer, governance and a query engine so both BI and ML run on one copy.
"A data lake gives you cheap storage in open formats for any kind of data, but no transactions or reliable schemas. A warehouse gives you reliability and fast SQL but locks the data in and does not suit unstructured data or machine learning. The lakehouse keeps the data in open formats on object storage and adds a transactional table format, a catalog and fast engines on top, so analysts and data scientists work on the same copy."
Describing it as 'a data lake plus a warehouse side by side'.
Format: Parquet data files plus a transaction log that records every commit as an ordered set of actions.
Adds: ACID transactions, schema enforcement and evolution, time travel, updates, deletes and merges, and unified batch and streaming reads and writes.
Why it matters: concurrent readers and writers see consistent snapshots; failed jobs leave no half-written tables.
"A Delta table is a folder of Parquet files with a transaction log next to them. The log is an ordered record of which files were added and removed in each commit, so readers see a consistent snapshot, writers get ACID guarantees, and a failed job cannot leave partial data visible. On top of that you get schema enforcement, time travel to earlier versions, real updates, deletes and merges, and the same table works as a streaming source and sink."
Saying Delta is a different file format from Parquet, or not mentioning the log.
Bronze: raw data as ingested, append-only, with source metadata; the replayable record.
Silver: cleaned, deduplicated, typed and conformed; joined into business entities.
Gold: aggregated, business-level tables shaped for dashboards and features.
"Bronze holds data exactly as it arrived, with ingestion metadata, so you can always reprocess from it. Silver applies cleaning, deduplication, typing and joins, producing trustworthy entity tables. Gold holds the aggregates and business-level views that dashboards and models read. Each layer is a Delta table, and quality rules get stricter as you move up."
Putting business logic in bronze, or treating the layers as folder names with no rules.
Lazy: transformations build a logical plan; an action triggers execution.
Planning: the driver optimises the plan and splits it into stages at shuffle boundaries; each stage becomes tasks, one per partition.
Running: executors run tasks in parallel; the driver schedules and collects results.
"Transformations are lazy: they only build a plan. When an action runs, the driver optimises that plan and cuts it into stages wherever data has to be shuffled between nodes. Each stage is split into tasks, one per partition, and the executors run those tasks in parallel while the driver schedules them and gathers results. That is why the number of partitions and the number of shuffles decide most of a job's performance."
Not knowing what a stage boundary is, or that transformations are lazy.
Narrow: each output partition depends on one input partition, such as map and filter; no data movement.
Wide: output partitions need data from many input partitions, such as groupBy, join and distinct; requires a shuffle across the network and disk.
Cost: shuffles create stage boundaries, write intermediate data, and are where skew and spill show up.
"A narrow transformation like a filter works within a partition, so it pipelines with no data movement. A wide transformation like a group-by or a join needs rows with the same key on the same node, so Spark shuffles data across the cluster, writing it to disk and sending it over the network. Shuffles are the expensive part of almost every job, so I try to reduce them, broadcast small tables, and watch for skewed keys."
Not being able to name which operations cause a shuffle.
What: a central catalog for data and AI assets with a three-level namespace of catalog, schema and object.
Solves: one place for permissions, audit and lineage across workspaces; managed and external tables; volumes for files; row filters and column masks; sharing.
Practice: grants on catalogs and schemas, service principals for jobs, lineage to trace a bad column upstream.
"Unity Catalog is the governance layer: every table, view, volume, function and model lives under catalog dot schema dot name, and permissions, audit logs and lineage are managed centrally across all workspaces. It replaced per-workspace metastores, so a grant is made once. It also gives fine-grained control like row filters and column masks, and lineage that shows exactly which jobs and columns fed a table when something looks wrong."
Confusing it with the legacy Hive metastore, or not knowing the three-level namespace.
Time travel: query a table as of a version or a timestamp; the log knows which files made up that snapshot.
VACUUM: physically deletes data files no longer referenced by the current version and older than the retention period.
Consequence: after VACUUM you cannot travel to versions whose files were removed; set retention to match your recovery needs.
"Because the log records which files belonged to every version, I can query the table as of a version number or a timestamp and Delta reconstructs that snapshot. VACUUM removes files that the current version no longer references and that are older than the retention window, to reclaim storage. The catch is that those files are exactly what old versions needed, so after a VACUUM, time travel beyond the retention window stops working. I set retention deliberately and never shorten it casually."
Thinking time travel is unlimited, or running VACUUM with a tiny retention on a shared table.
OPTIMIZE: compacts many small files into fewer larger ones, which cuts file listing and read overhead.
Z-ORDER: co-locates rows with similar values of chosen columns in the same files, so statistics let queries skip files.
Liquid clustering: the newer approach that replaces partitioning plus Z-ORDER: clustering keys can change, layout is maintained incrementally, and it avoids over-partitioning.
"OPTIMIZE rewrites lots of small files into fewer big ones, which matters because streaming and frequent small writes create thousands of tiny files that slow every read. Z-ORDER goes further by sorting related values into the same files so the per-file statistics let the engine skip most of the table on filtered queries. Liquid clustering is the current recommendation: you declare clustering columns, the layout is maintained incrementally, you can change the keys later, and you avoid the small-partition problems of hard partitioning."
Partitioning by a high-cardinality column, or not knowing why small files hurt.
Auto Loader: the cloudFiles source that incrementally discovers new files in cloud storage, tracks what it has processed in a checkpoint, and handles schema inference and evolution.
Discovery: directory listing or file notifications, so it scales to very large directories.
Versus plain streaming: the basic file source lists the whole directory each batch and has no schema evolution.
"Auto Loader is a streaming source for files landing in cloud storage. It remembers which files it has processed in its checkpoint, so each file is ingested exactly once, and it can discover new files through notifications instead of listing a huge directory every time. It infers the schema, can evolve it when new columns appear, and captures rows that do not fit. The plain file source re-lists everything and breaks on schema changes, so Auto Loader is the default for bronze ingestion."
Copying files with a scheduled batch job and deduplicating by hand.
Checkpoint: stores source offsets and state per micro-batch, so a restart resumes from the last committed batch.
Exactly once: replayable sources plus idempotent sinks; a Delta sink records the batch id in its commit so a replayed batch is skipped.
Triggers: processing-time intervals for continuous runs, available-now to process everything pending and stop, which suits scheduled incremental jobs.
"Structured Streaming processes data in micro-batches and writes the source offsets and any state to a checkpoint after each batch. If the job restarts it replays from the last committed offsets. Exactly-once comes from combining that replay with an idempotent sink: a Delta table records the batch id in its transaction, so if the same batch is replayed it is ignored. Triggers control cadence: a fixed interval for an always-on stream, or available-now to drain everything pending and stop, which lets me run a streaming pipeline as a cheap scheduled job."
Deleting the checkpoint to fix a problem, or not knowing why the sink must be idempotent.
Idea: declare tables as streaming tables or materialised views with SQL or Python; the platform works out dependencies, orchestration, retries and infrastructure.
Quality: expectations declare rules per table and choose whether to warn, drop or fail on bad rows.
Use when: standard medallion pipelines where you want less operational code; avoid when you need custom control over execution.
"With declarative pipelines, the product previously called Delta Live Tables and now part of Lakeflow, I define each table as a query and mark it streaming or materialised, and the service builds the dependency graph, runs it, retries failures and manages compute. Expectations let me attach data-quality rules to a table and decide whether bad rows are logged, dropped or fail the run. I use it for the normal bronze-silver-gold shape because it removes a lot of orchestration code; for unusual processing I write regular jobs."
Not knowing expectations exist, or treating it as a scheduler.
All-purpose: interactive clusters for notebooks and exploration; shared, long-running, dearer per hour.
Job clusters: created for a job run and terminated after; cheaper and isolated; the default for production.
Serverless: platform-managed compute that starts fast and scales without cluster configuration; Photon: the native vectorised engine that speeds up SQL and DataFrame work.
"All-purpose clusters are for people: notebooks, exploration, shared sessions. Production jobs should run on job clusters that spin up for the run and disappear after, which is cheaper and keeps runs isolated. Serverless removes cluster management entirely and starts in seconds, which suits SQL warehouses and many jobs. Photon is the vectorised execution engine that accelerates SQL and DataFrame operations, so I turn it on for SQL-heavy workloads and measure the difference."
Running scheduled production jobs on a shared all-purpose cluster.
Diagnosis: one partition holds far more rows for a hot key; the Spark UI shows one long task and spill to disk.
Fixes: adaptive query execution's skew join handling, broadcast the small side if it fits, salt the hot key to spread it, or pre-aggregate.
Also check: partition count, spill, and whether the table layout supports the filter.
"That pattern is skew: a few keys, like a null or a default customer id, hold most of the rows, so one task does most of the work and spills to disk. First I confirm it in the Spark UI by looking at task durations and shuffle sizes for that stage. Then, in order: make sure adaptive query execution is on so skewed partitions get split, broadcast the smaller table if it fits in memory, and if the big-to-big join is still skewed, salt the hot keys so they spread across partitions. I also check whether the null keys should be in the join at all."
Just adding more nodes, which does not help when one task holds the data.
MERGE INTO: match on keys, update matched rows, insert new ones, optionally delete rows missing from the source.
Change Data Feed: enable it on a table to read row-level changes between versions for downstream incremental processing.
Slowly changing dimensions: type one overwrites; type two closes the old row and inserts a new one with validity dates; declarative pipelines have a built-in apply-changes step.
"For upserts I use MERGE INTO with the business key: update rows that match, insert the ones that do not, and delete or expire rows that disappeared if the source is a full snapshot. To propagate changes downstream I enable the change data feed on the table, which lets the next stage read only the inserts, updates and deletes since the last version it processed. For history I keep type-two dimensions with start and end dates, and in declarative pipelines the apply-changes step does that for me."
Overwriting whole tables every run, or deduplicating with full-table joins instead of MERGE.
DataFrame cache: cache or persist keeps a computed result in executor memory or disk; lazy until the next action; worth it when the same result is reused several times.
Disk cache: Databricks automatically caches remote Parquet and Delta file reads on local SSD; transparent, no code.
Discipline: unpersist when done; caching a large one-off result can evict useful data and slow everything.
"I cache a DataFrame only when I will reuse that exact result more than once in the job, for example a cleaned table that feeds three aggregations; it is materialised on the next action and lives in executor memory or spills to disk. Separately, the platform's disk cache keeps copies of remote files on the node's local SSD automatically, which speeds repeated reads with no code. And I unpersist when I am done, because an unused cache is just memory taken from shuffles."
Caching everything by reflex, or not knowing cache is lazy.
SQL warehouse: compute dedicated to SQL queries and BI tools, with Photon and result caching; serverless versions start quickly.
Use for: dashboards, ad-hoc analyst queries, BI connections; not for Python pipelines.
Clusters: for notebooks, ETL code and ML.
"A SQL warehouse is compute purpose-built for SQL: analysts and BI tools connect to it, it runs Photon, caches results, and the serverless option starts in seconds and scales with concurrency. I point dashboards and ad-hoc SQL at a warehouse and keep clusters for engineering and ML work in notebooks and jobs, so BI traffic never competes with a pipeline."
Pointing a BI tool at an all-purpose cluster.
Jobs: a job is a graph of tasks, such as notebooks, Python scripts, SQL, pipelines or dbt, with dependencies, retries and alerts.
Parameters: job-level parameters and task values pass dates, environments and ids between tasks; notebooks read them as widgets.
Triggers: schedules, file-arrival triggers and API calls; run as a service principal with least privilege.
"I build a job as a graph of tasks with explicit dependencies, so the silver step runs only after bronze succeeds, with retries on transient failures and alerts on failure. Parameters like the run date and the target environment are defined on the job and read inside each task, and tasks can hand values to downstream tasks. Jobs run under a service principal with only the grants they need, and they use job clusters or serverless rather than a shared cluster."
Chaining notebooks by hand inside one notebook, or running jobs under a personal account.
Tracking: experiments and runs record parameters, metrics and artefacts; autologging captures most frameworks.
Registry: models are registered in Unity Catalog with versions, aliases and permissions.
Serving: registered models deploy to model serving endpoints; lineage connects training data to the model.
"MLflow is built in. Training runs log parameters, metrics and artefacts to an experiment, mostly automatically through autologging. When a model is good I register it in Unity Catalog, where it gets versions and aliases like champion and challenger, and the same permissions model as tables. From there it can be deployed to a serving endpoint, and lineage shows which tables trained it, which is what makes audits possible."
Saving model files to random storage paths and tracking them in a spreadsheet.
Compute habits: idle all-purpose clusters with no auto-termination, jobs on shared clusters, oversized fixed clusters.
Job efficiency: shuffles and spill in the Spark UI, small files, missing data skipping, recomputing full tables instead of incremental loads.
Tooling: system billing tables to see cost by job and user; autoscaling, spot instances, serverless where it fits.
"I start with the billing system tables to see which jobs, clusters and users the spend comes from, because it is usually a few things. Then the common culprits: interactive clusters left running without auto-termination, production jobs on shared clusters instead of job clusters, and clusters sized for peak all day. After that I look inside the top jobs for wasted work, like full reloads that should be incremental, small-file bloat and skewed shuffles. Fixing habits usually saves more than tuning code."
Jumping to code tuning before looking at idle compute.
Databricks interviews jump from 'explain the medallion layers' to 'why did this join spill' to 'what does VACUUM break' in the same ten minutes. The follow-ups are where candidates stall, and the frame has to be ready before the pause gets long.
ClapAssist is your silent co-pilot. Runs natively on macOS and Windows, listens to the interviewer's exact question, and surfaces concise talking points right next to your camera eye-line. Excluded at the OS level from Zoom, Google Meet, and Teams screen sharing.