Essential cookies keep authentication working. With your permission, we also use analytics cookies to understand and improve the product. Read our Privacy Policy

DataEngPrep.tech
QuestionsPracticeAI CoachDashboardPricingBlog
ProLogin
Home/Questions/System Design/Architecture/How would you handle a schema change when new files arrive?

How would you handle a schema change when new files arrive?

System Design/Architectureeasy2 min read

Reviewed by Aditya Kumar · Last reviewed 2026-08-08

When new files arrive with schema changes, the primary approach involves prioritizing additive schema evolution, validating incoming data against an expected schema, and leveraging robust data lake…

🤖 Analyze Your Answer
Frequency
Low
Asked at 1 company
Category
179
questions in System Design/Architecture
Difficulty Split
15E|6M|158H
in this category
Total Bank
1,863
across 7 categories
Asked at these companies
Delivery Hero
Interview Pro Tip

Pro-Move: 'New column "region" arrived. Pipeline added with default null. Backfill job for historical. Both versions supported for 2 weeks.'

Why This Question Matters

This easy-level System Design/Architecture question appears frequently in data engineering interviews at companies like Delivery Hero. While less common, it tests deeper understanding that distinguishes strong candidates.

How to Approach This

Start by clearly defining the core concept being asked about. Interviewers want to see that you understand the fundamentals before diving into implementation details. Structure your answer with a definition, then explain the practical application with a concise example. The expert answer includes a code example that demonstrates the implementation pattern.

Expert Answer
323 wordsIncludes code

When new files arrive with schema changes, the primary approach involves prioritizing additive schema evolution, validating incoming data against an expected schema, and leveraging robust data lake table formats or schema registries to manage and enforce these changes seamlessly.

Schema Evolution and Validation

The most common strategy is additive schema evolution, where new columns are added, and existing ones are never removed or re-typed incompatibly. For older records lacking new columns, default values (often NULL) are assigned, ensuring backward compatibility. This maintains a consistent view for existing consumers. Data validation is crucial. Incoming data should be checked against the current schema. Records or files with unexpected columns, incorrect data types, or missing mandatory fields should be quarantined, rejected, or routed to a dead-letter queue to maintain data quality and prevent downstream failures.

Tools and Techniques

Schema Registries (e.g., Confluent Schema Registry for Kafka) act as central repositories for schema definitions, enforcing contracts between data producers and consumers. This is vital in event-driven architectures where producers register schemas and consumers retrieve them, ensuring compatibility and managing schema versions. For batch processing in data lakes, modern table formats like Delta Lake, Apache Iceberg, or Apache Hudi provide built-in schema evolution capabilities. They manage schema changes through a transaction log, allowing operations like adding columns or changing column comments without rewriting entire datasets. For example, in PySpark with Delta Lake, the mergeSchema=True option automatically adds new columns from incoming data to the table schema.
df.write.format("delta") \
  .mode("append") \
  .option("mergeSchema", "true") \
  .save("/path/to/delta_table")

This approach ensures that consumers can adapt to evolving schemas. For significant, breaking changes (e.g., removing a column), a new version of the dataset might be published, requiring consumers to explicitly migrate or be updated to handle the new structure.

In the interview, also mention: The trade-off between strict schema enforcement (higher data quality, less flexibility) and schema evolution (more flexibility, potential for data quality issues if not managed well).

⚡
Pro Tip

Pro-Move: 'New column "region" arrived. Pipeline added with default null. Backfill job for historical. Both versions supported for 2 weeks.'

Want all answers as a PDF for offline study?
Seven focused volumes with 750+ in-depth answers — Answer Vault →

Related System Design/Architecture Questions

hardWhat architecture are you following in your current project, and why?FreeeasyCDC During Migration - explain approaches for real-time Change Data CaptureFreehardBriefly explain the architecture of Kafka.FreehardDescribe the data pipeline architecture you've worked with.FreehardExplain the trade-offs between batch and real-time data processing. Provide examples of when each is appropriate.Free

Level up your prep

Recommended
Educative
Educative Unlimited

800+ hands-on courses — Grokking System Design, Coding Patterns, and AI mock interviews for your DE loop.

Start learning →

Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you — it helps keep DataEngPrep free.

According to DataEngPrep.tech, this is one of the most frequently asked System Design/Architecture interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.

← Back to all questionsMore System Design/Architecture questions →
Categories
All QuestionsSQLSpark / Big DataPython / CodingSystem DesignCloud / ToolsBehavioral
By Company
AmazonGoogleDatabricksSnowflakeAWSAzureMicrosoftNetflixUberTCS
Interview Guides
All GuidesTop SQL QuestionsTop Spark QuestionsPySpark QuestionsTop Python QuestionsTop System DesignKafka QuestionsAirflow QuestionsSQL Window FunctionsETL QuestionsData Modeling
Products
AI Interview CoachAnswer AnalyzerSQL PlaygroundResume AnalyzerAnswer Vault PDFsPricing
Company
About & Editorial PolicyContact UsAI DisclosureDisclaimerTerms of ServicePrivacy Policy
© 2026 DataEngPrep.tech. All rights reserved.
AboutBlogContactDisclaimer