cswork / libraryOpen practice workspace

Articles

Avro vs Parquet in Data Engineering Interviews: Events, Tables, and Evolution

Avro vs Parquet interview questions explained: separate event contracts from analytic files, reason about schema evolution, and defend a pipeline design.

Avro and Parquet are often presented as a file-format choice. In a strong data engineering interview answer, they solve different boundaries. Avro is commonly chosen to serialize records that move through an event or RPC boundary with an explicit writer schema. Parquet is a columnar file format chosen so analytical engines can read selected columns and skip work. A pipeline can use both without contradiction.

The decisive question is therefore not “which format is faster?” It is: where does the producer–consumer contract end, and where does a stable table become a read-optimized analytical asset?

Establish the evidence boundary before answering

Official or primary-source facts. Apache Avro specifies writer and reader schema resolution and records the schema in an object container file. Apache Parquet documents a columnar file format and separately documents reader and writer compatibility as format features evolve. The linked sources at the end support those facts and should take priority if a framework or toolchain changes.

Candidate reports. This is a technical-topic guide, not a company-process guide. I found no reliable, same-cycle candidate-report set that adds a general rule for this topic, so this article makes no claim about a particular employer’s interview format, scoring, or implementation choice.

Reasoned practice guidance. The scenarios, diagnosis order, and acceptance gates below are engineering inferences. They are intentionally framed as things to test in a stated environment, not as universal behavior.

Build the mental model, not a slogan

For an event, start with the unit of change: one order-created message, one profile update, or one device reading. Consumers need a record boundary, field names and types, and a compatibility policy. Avro gives the producer and consumer a concrete schema negotiation problem. Adding an optional field with a reader default is a different change from renaming a field, narrowing a numeric type, or deleting a field that an old reader still expects.

For a lake table, start with the access pattern. A query that requests event_date, country, and a revenue aggregate should not need to decode a wide JSON-like record field by field. Parquet stores data by column and its physical and logical types help query engines interpret values. Partitioning, file sizing, statistics, and table-catalog semantics sit around Parquet; they are not replaced by it.

This distinction prevents a common mistake: treating a Parquet file as the event contract itself. A batch writer can make a syntactically valid Parquet output while silently changing a column meaning. Conversely, an event payload may be safely compatible while still producing an inefficient lake layout. State both contracts and their separate tests.

An interviewer may change one assumption halfway through: distributed workers, a new data slice, a checkpoint resume, a different ABI, or a new attacker capability. Return to the boundary and state which observation would change your answer. That is stronger than defending a memorized rule.

Work a bounded interview exercise

Prompt. A payments platform publishes payment_authorized events to several services and writes a daily fraud-analysis table. Product wants to add merchant_country; a later request changes amount from integer cents to a decimal amount. Explain which changes you allow, where they are checked, and how a historical backfill is made readable.

1. First, put the event schema under compatibility checks before publishing. Add merchant_country as a nullable field or give readers a defensible default only when that default preserves the meaning of older events. Do not call an invented value such as US a compatibility default. It changes the data rather than describing its absence.

2. Second, keep the canonical monetary representation explicit. An integer number of minor units has different precision and rounding rules from a decimal field. A safe migration normally adds a new field, dual-writes with a reconciliation metric, migrates consumers, and retires the old field after an announced window. The exact promotion rules must match the serializer and registry implementation, so verify them against the chosen tooling instead of relying on a remembered Avro rule.

3. Third, write the analytical projection to a versioned table contract. Backfill old events through the same transformation or a version-aware equivalent, record the transform version, compare row counts and money totals, then atomically expose the new table version. Query performance work follows: partition by a predicate with real selectivity, retain typed columns, and avoid one tiny Parquet file per event.

The final answer should name a stop condition. For example: roll back a release if a protected slice crosses its error budget; reject a schema change if compatibility tests fail; stop a performance tune if the profile shows the presumed allocation is not material. A decision with a measured exit condition is more useful than an unbounded exploration.

Debug from evidence in this order

  • Schema evolution: test old writer/new reader and new writer/old reader combinations that the compatibility policy promises.
  • Meaning: compare the business definition of each changed field, including units, time zone, null policy, and source precedence.
  • Table quality: measure file counts, column statistics, partition skew, and a representative query plan after the backfill.
  • Recovery: retain the event offset or immutable input and the previous table snapshot so a transformation bug can be corrected without inventing history.

This sequence is deliberately conservative. It separates a fact established by a specification or runtime document from a local observation, then asks for the smallest intervention that can disprove the current theory. It also produces artifacts a reviewer can reproduce: an input slice, command line or configuration, before/after measurement, and rollback point.

Turn the explanation into an engineering decision

For Avro vs Parquet in Data Engineering Interviews: Events, Tables, and Evolution, practice a one-page decision record rather than a stream of concepts. Begin with the user-visible or system-level failure: a bad slice metric, incompatible reader, allocation spike, unsafe data path, or portability assumption. State what must remain true after the change. This is the invariant. Examples include preserving a monetary value’s unit, keeping a request within a latency budget, preventing untrusted data from reaching a sensitive operation, or retaining the behavior promised by an API. An invariant makes it possible to reject an attractive implementation that optimizes the wrong thing.

Next, make the scope testable. Name the build or runtime version, data slice, traffic window, hardware, model checkpoint, compiler target, or security boundary that applies. A concise qualifier is more credible than a universal statement. “Under this ONNX Runtime build on the target CPU,” “for the old writer and new reader compatibility matrix,” or “when this request is reachable without an authorization guard” gives the interviewer a condition they can challenge. If the condition is unknown, say which document, log, experiment, or source inspection would resolve it.

Then compare two or three options against the invariant. For each option, write its mechanism, benefit, failure mode, and proof. A mechanism is not a benefit: a lower quantization range may improve resolution near zero but may saturate a rare activation; a broader CodeQL query may find more paths but can consume triage capacity; a new layout may reduce bytes but create an ABI or alignment cost. The proof should be concrete: a compatibility matrix, fixed-input test, profile, slice evaluation, path trace, or compiler output. It should include the baseline so an apparent improvement has meaning.

Make rollback part of the design. Identify which input, model, schema, configuration, or binary remains available; which metric triggers a stop; and who can act. A rollback plan does not imply the change is unsafe. It demonstrates that the team can learn from a bounded experiment without turning a local defect into unrecoverable history. For a non-reversible boundary, such as schema deletion or a public API contract, replace rollback with a staged migration and an explicit deprecation window.

Finally, communicate uncertainty precisely. Say “the documentation establishes X,” “the trace or benchmark establishes Y in this build,” and “I infer Z, so I would validate it with W.” That separation is especially important for Data Engineer work, where a mechanism may be correct while the proposed operational response is still wrong for the product’s constraints. It also keeps an interview answer honest when the interviewer has intentionally withheld a critical fact.

A five-minute whiteboard drill

Use this repeatable drill before an interview. Spend the first minute drawing the data, object, update, or control-flow boundary relevant to the prompt. Spend the second minute labeling the state that crosses the boundary and the state that must remain local, immutable, compatible, bounded, or trusted. Spend the third minute naming the symptom and listing two competing hypotheses. Spend the fourth minute choosing the cheapest discriminating observation. Spend the final minute proposing a small fix, an acceptance metric, and a rollback or migration path.

This format avoids a common failure mode: changing a configuration while several causes remain plausible. It also prevents a different failure mode: producing a technically elegant design with no evidence it works in the environment. If a panel asks for code, implement a narrow probe that exposes one invariant. If it asks for system design, write the observability and ownership fields next to the component diagram. If it asks for debugging, lead with the evidence you would gather before naming the fix.

Score your own response on five questions. Did it name the boundary? Did it distinguish a documented fact from a local observation? Did it identify an assumption that could reverse the recommendation? Did it specify a measurement that falsifies the current theory? Did it include a safe next action? A “yes” to all five usually signals stronger engineering judgment than adding another unsupported optimization detail.

When the prompt gives incomplete information, say so without stopping. Choose a provisional assumption that minimizes risk, explain why it is provisional, and state the first observation you would request. For example, a performance question may need a profile and workload distribution; a model question may need a protected evaluation slice; a security question may need the actual sink API and route reachability. This is not hedging. It is a way to turn uncertainty into an ordered investigation. A candidate who can do that will usually make better trade-offs after the interview too.

How to answer follow-up questions well

  1. Draw two boundaries before naming a format: producer to consumer and transformed events to analytical table.
  2. Use the words backward, forward, and full compatibility only after saying which reader and writer versions must interoperate.
  3. Explain one unsafe semantic change, such as cents becoming an unqualified decimal, rather than claiming every type change is safe.
  4. Describe a dual-write and reconciliation window for a breaking change.
  5. Close with observable proof: compatibility tests, row and amount reconciliation, and representative query cost.

Avoid two common interview failures. First, do not make a tool guarantee that its documentation does not make; qualify compiler, hardware, library, and deployment assumptions. Second, do not answer with a bag of keywords. A compact causal chain—input or state, mechanism, observable symptom, verification, reversible fix—lets the interviewer assess your judgment.

Sources and Further Reading