Question 1
Which statement about integration tests for a data pipeline is correct?
- They test single functions in isolation
- They only check code style
- They run the pipeline end to end in a test environment — Correct
- They run in production on live data
Correct answer
They run the pipeline end to end in a test environment
Explanation
Integration tests validate that components work together, typically after deploying to a test target.
Question 2
Which approach deploys a Lakeflow declarative pipeline through CI/CD?
- Export it as CSV
- Use a cluster init script
- Define it in a bundle and deploy it — Correct
- Create it manually in each workspace
Correct answer
Define it in a bundle and deploy it
Explanation
Bundles manage pipelines as resources across targets.
Question 3
A data engineer wants to unit test a transformation function that takes and returns a DataFrame. Which approach is best practice?
- Skip testing because Spark functions cannot be tested
- Test it by running the production job and inspecting the output table
- Move it to a module and test with pytest — Correct
- Write tests as markdown cells in the notebook
Correct answer
Move it to a module and test with pytest
Explanation
Modular code is testable with pytest; pyspark.testing provides DataFrame comparison utilities.
Question 4
Which job design allows a failed task in a backfill of 100 dates to be rerun without rerunning successful dates?
- Create one job per date manually
- Run all dates in a single notebook loop without checkpointing
- Use a for each task and repair the run — Correct
- Use a continuous job
Correct answer
Use a for each task and repair the run
Explanation
Repair reruns only failed iterations.
Question 5
Which statement about the Lakeflow Jobs 'for each' task in large backfills is correct?
- It is limited to SQL tasks
- It cannot pass parameters
- It runs all inputs on the driver sequentially
- It runs a nested task per input with set concurrency — Correct
Correct answer
It runs a nested task per input with set concurrency
Explanation
For each tasks parallelize backfills over parameter lists.
Question 6
Which bundle setting validates that production deployments use a service principal and specific settings?
- include: '*.yml'
- mode: production — Correct
- databricks bundle init
- mode: development on prod
Correct answer
mode: production
Explanation
Production mode enforces checks such as no development prefixes and requires appropriate run_as configuration.
Question 7
A bundle deploys jobs, pipelines and dashboards. Which CI/CD sequence is recommended?
- Deploy to production first, then test
- Only validate YAML and skip tests
- Deploy directly to production from developer laptops
- PR: validate, test, deploy to test; merge: deploy to prod — Correct
Correct answer
PR: validate, test, deploy to test; merge: deploy to prod
Explanation
Automated tests in a non-production target gate production deployments.
Question 8
A job is configured with a Git source and a branch. What happens at each run?
- The job fails unless a tag is used
- The job uses a cached copy from its creation date
- The job runs code from the workspace's personal folders
- It runs the latest commit of that branch — Correct
Correct answer
It runs the latest commit of that branch
Explanation
Jobs with Git sources fetch the specified ref at run time; pinning a tag gives fixed versions.
Question 9
A data engineer needs to run Python code in a pipeline that imports a shared library from the repository. Which approach is best for bundles?
- Build a wheel in the bundle and attach it to tasks — Correct
- Copy the code into every notebook
- Store it in the DBFS root without versioning
- Install it manually on each cluster
Correct answer
Build a wheel in the bundle and attach it to tasks
Explanation
Bundles can build artifacts such as wheels and attach them to tasks, keeping versions consistent.
Question 10
A test must compare an output DataFrame with an expected one, ignoring row order. Which utility helps?
- df.show()
- dbutils.fs.ls
- assertDataFrameEqual — Correct
- df.explain()
Correct answer
assertDataFrameEqual
Explanation
assertDataFrameEqual compares schema and data, with options for ordering and tolerance.