Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan

Optimize Slow Spark ETL Pipeline

HardPipelines00:00
Practice interviewer
In session
5 left
00:00

Your question is Optimize Slow Spark ETL Pipeline. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Context

A Databricks customer runs a nightly ETL pipeline on the Databricks Data Intelligence Platform to transform raw product, order, and clickstream data into Delta tables used by finance and growth analytics. The current pipeline, implemented as a Databricks Job with Spark SQL and PySpark notebooks, has regressed from 45 minutes to over 3 hours, causing SLA misses for downstream dashboards and model features.

You are asked to diagnose and redesign the pipeline for performance while preserving correctness and operational simplicity. Assume the pipeline reads from Bronze Delta tables, builds Silver business entities, and publishes Gold aggregates in Unity Catalog.

Scale Requirements

  • Input volume: 12 TB/day across 3 Bronze Delta tables
  • Daily rows processed: ~18 billion records
  • Peak skew: top 0.5% of customer IDs account for 35% of events
  • SLA: Gold tables available by 6:00 AM UTC
  • Current runtime: 3+ hours; target is under 60 minutes
  • Cluster: Databricks Jobs compute, 20 workers, i3.xlarge equivalent, Photon enabled where possible
  • Retention: 180 days in Bronze, 2 years in Gold

Requirements

  1. Identify likely Spark bottlenecks across joins, shuffles, file layout, skew, and inefficient transformations.
  2. Propose an optimized Databricks pipeline design using Delta Lake, Databricks Workflows, and Unity Catalog.
  3. Explain how you would tune partitioning, caching, broadcast joins, Adaptive Query Execution, and file compaction.
  4. Define how to validate that optimizations do not change row counts, business logic, or idempotency.
  5. Include monitoring for stage runtime, shuffle spill, skewed tasks, small files, and Delta table health.
  6. Describe how you would handle backfills and rollback if a performance change degrades correctness.

Constraints

  • Prefer native Databricks capabilities over external tools.
  • Budget allows at most a 20% increase in compute spend.
  • PII is governed in Unity Catalog; no unmanaged copies outside approved storage.
  • The team wants notebook-to-production migration into reusable pipeline code within one quarter.