EY Interview Questions
PySpark provides several methods to handle null values depending on the use case: Best practices : Use dropna() when nulls indicate corrupted data Use f...
How do you handle null values in PySpark?
PySpark provides several methods to handle null values depending on the use case: Best practices : Use dropna() when nulls indicate corrupted data Use fillna() for known default values (e.g., 0 for missing counts) Use mean/median imputation for ML feature columns Log null counts before and after treatment for data quality auditing
What is AQE (Adaptive Query Execution) in Databricks?
Adaptive Query Execution (AQE) is a Spark 3.0+ optimization framework that re optimizes query plans at runtime using actual statistics collected during execution, rather than relying solely on static compile time estimates. Three main AQE features : 1. Dynamically coalescing shuffle partitions : After a shuffle, AQE merges small partitions into fewer, larger ones — reducing task overhead. Controlled by spark.sql.adaptive.coalescePartitions.enabled=true . 2. Dynamically switching join strategies
How do you implement error handling in ADF pipelines?
Azure Data Factory (ADF) provides multiple levels of error handling: 1. Activity level error handling : Each activity has On Success , On Failure , and On Completion dependency conditions Connect a failure branch to a notification activity (e.g., send email via Logic Apps or call a webhook) 2. Try Catch pattern : 3. Retry policies : Configure Retry count and Retry interval on each activity for transient failures (network timeouts, API throttling). 4. Pipeline level error handling : Use Execute P
How do you track file names in ADF copy activity outputs?
In ADF, the Copy Activity exposes an output object with metadata about transferred files. You can capture file names using the activity output variable. Method 1: Use the activity output in a downstream activity Method 2: Enable logging in Copy Activity In the Copy Activity settings, enable "Logging settings" Point to an ADLS/Blob path for the log ADF writes a CSV log file listing all files copied, skipped, or failed with full paths Method 3: Use Get Metadata activity before Copy In the ForEach,
Write a SQL query to calculate cumulative sum.
Cumulative sum (running total) is computed using the SUM() window function with an ordered frame: Key syntax : ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW is the standard frame for a running total. In most databases, ORDER BY alone in the window defaults to this frame, but being explicit improves readability. In PySpark :
Explain the role of Azure Key Vault.
Azure Key Vault is a cloud service for securely storing and managing sensitive information — secrets, encryption keys, and certificates — centralizing credential management across Azure services. Key roles in data engineering : 1. Secret management : Store database passwords, API keys, storage account keys, connection strings. Services retrieve secrets at runtime rather than embedding them in code or config files. 2. Encryption key management : Manage Customer Managed Keys (CMK) for encrypting d
How do you automate ETL using Databricks Workflows?
Databricks Workflows (formerly Jobs) is the native orchestration layer for automating notebooks, Python scripts, Delta Live Tables pipelines, and dbt tasks. Creating a workflow : 1. Go to Workflows in Databricks UI → Create Job 2. Add tasks: Notebook, Python script, JAR, Spark Submit, SQL, dbt, or Delta Live Tables 3. Define dependencies between tasks (task A → task B creates a DAG) 4. Set a schedule (cron expression or every X minutes) 5. Configure cluster per task (job cluster for isolation, a
How do you set up disaster recovery for ADLS?
Azure Data Lake Storage (ADLS) Gen2 disaster recovery involves geo redundancy, failover, and backup strategies: 1. Redundancy options (choose at account creation): LRS (Locally Redundant Storage): 3 copies in one datacenter — no DR ZRS (Zone Redundant): 3 copies across availability zones in one region GRS (Geo Redundant): Async replication to secondary region, RPO ~15 min RA GRS (Read Access GRS): GRS + read access to secondary region endpoint GZRS / RA GZRS : Zone redundant primary + geo replic