Microsoft Interview Questions
Batch pipeline : Streaming pipeline : Key design decisions : Bronze/Silver/Gold (Medallion) : separate raw, cleansed, and business ready layers Incremen...
Explain end-to-end pipeline design for large-scale batch and streaming.
Batch pipeline : Streaming pipeline : Key design decisions : Bronze/Silver/Gold (Medallion) : separate raw, cleansed, and business ready layers Incremental loading : only process new data using watermarks or CDC Partitioning : partition Delta tables by date for efficient pruning Orchestration : ADF pipelines or Databricks Workflows for scheduling and dependency management Monitoring : Azure Monitor + Log Analytics for job health; Data Factory monitoring for pipeline runs
How do you build fault-tolerant ETL systems in Azure?
ADF pipeline retries : configure retry count and interval on each activity (typically 3 retries, 2 minute delay) Idempotent writes : use Delta Lake MERGE INTO so re runs don't create duplicates Checkpointing : in Spark Streaming, write Kafka offsets to ADLS after each micro batch Dead letter pattern : route malformed records to a quarantine Delta table instead of failing the pipeline Activity level error handling : in ADF, use dependsOn with Failed condition to route errors to notification activ
Design a data warehouse using Synapse Analytics.
Architecture : Synapse SQL Pool (dedicated): star schema for BI workloads Synapse Spark Pool : heavy transformations, ML feature engineering ADLS Gen2 : underlying storage for both pools Synapse Link : near real time sync from Cosmos DB or Dataverse Schema design : Optimization : use hash distribution on the most joined key; replicate small dimension tables; use RESULT SET CACHING for repeated expensive queries.
Write performant Spark code for data transformations.
Key rules : prefer built in functions over Python UDFs (10 100x faster), push filters early, repartition on join keys before large joins.
Discuss data partitioning and indexing strategies in large tables.
Partitioning : Range partition : by date — most common. WHERE date = '2024 01 01' skips older partitions entirely Hash partition : by user id — even distribution for skew free parallel processing List partition : by region/country — useful for data residency requirements Target partition size : 128 MB–1 GB per file in Spark/Delta Delta Lake file skipping : OPTIMIZE + ZORDER BY (customer id, date) : co locate related data → fewer files read per query Bloom filters on high cardinality string colum
Implement incremental loads in Azure Data Factory.
Watermark pattern (most common): In ADF: 1. Lookup activity: read last loaded ts from watermark table 2. Copy activity: source query = SELECT FROM orders WHERE updated at @{activity('Lookup').output.firstRow.last loaded ts} 3. Stored Procedure activity: update watermark with MAX(updated at) from the loaded batch CDC alternative : use ADF's built in Change Tracking (SQL Server) or Debezium → Event Hub → ADF → Delta. Partition based : load only today's partition dt = @{formatDateTime(utcnow(), 'yy
Manage credentials using managed identities vs service principals.
Managed Identity Service Principal Credentials No secrets — Azure manages automatically Client ID + secret or certificate Rotation Automatic Manual (or with Key Vault rotation) Scope Azure resources only Any OAuth2 endpoint Use case ADF → ADLS, Databricks → Key Vault App accessing external APIs, cross tenant Best practice : use Managed Identity wherever possible — eliminates credential management overhead. In ADF : assign System assigned Managed Identity to the ADF instance → grant Storage Blob
Explain integrating Databricks with ADF for orchestration.
Pattern : ADF for scheduling and workflow orchestration; Databricks for heavy Spark computation. Integration steps : 1. Create a Databricks Linked Service in ADF (using Managed Identity or PAT token) 2. Use Databricks Notebook or Databricks Job activity in ADF pipeline 3. Pass parameters from ADF to notebook: dbutils.widgets.get("start date") Architecture : Monitoring : ADF monitors notebook execution; failure propagates up to the pipeline and triggers alerts. Alternative : Databricks Workflows