Infosys Interview Questions
Job clusters and interactive clusters serve different purposes in Databricks: Job Cluster: Created automatically when a job is triggered and terminated...
Difference between a job cluster and an interactive cluster in Databricks.
Job clusters and interactive clusters serve different purposes in Databricks: Job Cluster: Created automatically when a job is triggered and terminated when the job completes Optimized for automated workloads — no idle cost since the cluster is destroyed after the run Cannot be shared across multiple jobs simultaneously Configured through the job definition (cluster policy, node type, autoscaling) Best for: ETL pipelines, scheduled batch jobs, CI/CD workflows Interactive Cluster: Long running cl
How do you copy all tables using metadata-driven pipelines in ADF?
A metadata driven pipeline in Azure Data Factory (ADF) dynamically copies all tables without hardcoding each table name. The pattern uses a control table and a ForEach loop. Steps: 1. Create a control table (e.g., in Azure SQL or a config file) listing tables to copy: 2. Lookup Activity — query the control table to retrieve the list of active tables. 3. ForEach Activity — iterate over the Lookup output ( @activity('LookupTables').output.value ) with batchCount for parallelism. 4. Copy Activity i
How do you implement data encryption in Azure SQL Database?
Azure SQL Database provides multiple layers of encryption to protect data at rest and in transit: 1. Transparent Data Encryption (TDE) — Data at Rest Enabled by default on all Azure SQL databases Encrypts the database, backups, and transaction logs using AES 256 Uses a Database Encryption Key (DEK) wrapped by a TDE protector Can use service managed keys or customer managed keys (CMK) via Azure Key Vault (Bring Your Own Key) 2. Always Encrypted — Column Level Encryption Encrypts sensitive columns
Write Python code to generate Fibonacci numbers.
Here are three common approaches to generate Fibonacci numbers in Python: 1. Iterative approach (most efficient for large n): 2. Generator (memory efficient for streaming): 3. Recursive with memoization (elegant but uses call stack): Time/Space complexity: Iterative: O(n) time, O(n) space Generator: O(1) space (yields one at a time) Recursive+memo: O(n) time with cache, O(n) call stack
Best practices for managing and optimizing storage costs in ADLS.
Azure Data Lake Storage (ADLS) Gen2 costs grow quickly without proper management. Key best practices: 1. Implement Lifecycle Management Policies Automatically tier data from Hot → Cool → Cold → Archive based on last access or modification time Example: Move to Cool after 30 days, Archive after 90 days Configure in Azure portal: Storage Account → Lifecycle Management 2. Use Appropriate Access Tiers Hot : Frequently accessed data (higher storage cost, lower access cost) Cool : Infrequently accesse
How do you implement security for data in transit and at rest in Azure?
Security in Azure spans two dimensions: data at rest (stored data) and data in transit (moving between services or over networks). Data at Rest: Azure Storage Service Encryption (SSE) : AES 256 encryption for all Azure Storage (Blob, ADLS, Files, Queues) — enabled by default TDE for Azure SQL/Synapse : Encrypts database files and backups automatically Azure Disk Encryption : Encrypts OS and data disks for VMs using BitLocker (Windows) or dm crypt (Linux) Customer Managed Keys (CMK) : Store encry
Describe the role of triggers and schedules in ADF.
Triggers in Azure Data Factory (ADF) determine when pipelines execute. There are three types: 1. Schedule Trigger Runs pipelines on a defined recurrence (hourly, daily, weekly, cron expression) Decoupled from pipelines — one trigger can fire multiple pipelines Supports time zone configuration Example: Run ETL pipeline every day at 2:00 AM UTC 2. Tumbling Window Trigger Fires at fixed size, non overlapping time intervals starting from a defined start time Maintains state — if a window is missed (
How do you optimize data storage and retrieval in ADLS?
Optimizing ADLS Gen2 involves both storage layout and query/retrieval patterns . Storage Format: Use Parquet or ORC (columnar formats) instead of CSV/JSON — enables column pruning and predicate pushdown Apply Snappy or ZSTD compression to reduce storage footprint and I/O Delta Lake adds ACID transactions, indexing ( Z ORDER ), and data skipping on top of Parquet File Size Optimization: Target 128MB–1GB per file for optimal parallelism in Spark Avoid small files (< 10MB) — use Delta OPTIMIZE or c