Skip to content
Tech Interview Prep
Technical interview guide

Schema Evolution & Versioning

Changing a shared schema without breaking every downstream consumer that depends on it.

Read
34 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed
Relevant for
Data Architect

Scope: Apache Avro and Iceberg current specifications, Protobuf edition 2024 guidance, Confluent Schema Registry current compatibility modes, Delta Lake protocol, PostgreSQL 18, JSON Schema 2020-12, OpenAPI 3.1.1, and Parquet logical types current 2026-08-31.

Curated: · Written: · Reviewed:

25 questions

MCQ-1A Kafka topic carries Avro-encoded payment events. Its Schema Registry subject is set to BACKWARD compatibility, and 40 consumer instances are running the v4 reader. The team registers v5, which adds a `currency` field of type string with no default, and the registry rejects it with HTTP 409. They must keep the subject name and the BACKWARD level. Which change lets v5 register and still lets the running v4 consumers read records the new producer writes?
MCQ-4A Kafka topic carries `OrderPlaced` events in Avro. Subject `orders-value` is at version 7 and the registry's compatibility level is BACKWARD. An engineer adds a field `discount_code` of type `["null","string"]` with no default, reasoning that the nullable type makes the change safe, and submits version 8. What does the registry do?
MCQ-24A Kafka topic's Avro subject in Schema Registry is set to BACKWARD compatibility, and v3 is the latest registered schema. The topic has 40 consumer groups; 6 still run the v3 reader. A producer team submits v4, which adds a `region` field of type string with no default. What does the registry return, and why?
MCQ-3A Confluent Schema Registry subject `users-value` (Avro) is set to BACKWARD_TRANSITIVE. Three versions are registered: - v1: `{id: string, email: string}` - v2: `{id: string, email: string, name: string (default "")}` - v3: `{id: string, email: string, name: string (default ""), age: int (default 0)}` A producer submits v4: `{id: string, email: string, name: string, age: int (default 0)}`. What does the registry do, and why?
MCQ-2A team runs Avro on Kafka with the registry set to FORWARD compatibility. Schema v1 is `{id: string, amount: long}`. On Monday they register v2, which adds `currency: string` with no default. The registry accepts it. On Tuesday they deploy the v2 consumers to all instances while v1 producers keep writing for two days. The v2 consumers immediately fail with an `AvroTypeException` when reading a v1 record. Why did the registry accept v2?
MCQ-9A payments topic has 12 consumer groups. The registry for the topic's subject is configured with BACKWARD compatibility. Three groups still run clients generated from schema v1; the other nine run v2. A producer registers v3, which removes a field that v1's generated classes require, and the registry accepts it. Within minutes the three v1 groups throw deserialization errors while the v2 groups are unaffected. What did the registry's acceptance actually establish?
MCQ-25A payments pipeline publishes Avro-encoded events to `payments.events` through a schema registry whose compatibility level for that subject is NONE. Schema v3 declares `currency` as a required string with no default. At 14:00 the producers deploy v4, which removes `currency`, and begin writing v4 records. The fraud-detector consumer group is six hours behind and is configured with reader schema v3. What happens to fraud-detector?
MCQ-10A team runs topic `orders` with subject `orders-value` at BACKWARD compatibility and 12 registered versions. They migrate the producer to RecordNameStrategy with record name `com.acme.Order` and, in the same release, change the `amount` field from `int` to `string`. Registration succeeds. Within the hour, 40 consumers still running the previous schema start failing to deserialize. What explains the successful registration?
MCQ-23A producer adds `coupon_code` (type `string`, no default) to its Avro record schema and deploys it before consumers are updated. A consumer still running the previous reader schema, which has no `coupon_code` field, reads records written with the new schema. What does the consumer do?
MCQ-5A Kafka topic holds 4.2 million Avro records written with a v1 schema `{orderId: string, status: string = "ACTIVE"}`. Of those records, 3.1 million carry `status = "ACTIVE"` and 1.1 million carry `status = "SHIPPED"`. The analytics consumer reads the topic with a v2 reader schema that keeps `orderId` and declares `status: string = "UNKNOWN"`. What does the consumer report for `status`?
MCQ-22A Kafka topic carries Avro-encoded events. The `status` field is an enum with symbols `PENDING` and `SETTLED`. The producer's schema is updated to add `REVERSED`, and it starts emitting events carrying that symbol. Two consumers read the topic with Avro 1.11, each supplying a reader schema: Consumer A supplies the previous schema, whose enum declares no default; Consumer B supplies the previous schema with `"default": "PENDING"` added to the enum. What does each consumer see for those events?
MCQ-6A topic's older records were produced with writer schema W (Order: id int, plan string with default 'basic'), and a producer serializes id = 3, plan = 'pro' into a 5-byte payload. A consumer built against reader schema R (Order: id int, plan string with default 'starter', tier string with default 'free') decodes that payload. Which record does the consumer produce?
MCQ-19A service writes Avro records to S3 with a bare `BinaryEncoder`: no schema registry and no container-file header, so only the encoded bytes are stored. The writer schema is `record Event { string id; }`. A record with `id = "7"` encodes to the two bytes `02 37` (length 1 as a zigzag varint, then the UTF-8 byte for `7`). Six months later the schema is changed to `record Event { int id; }`, and a consumer built against the new schema reads that stored record. What does the consumer see?
MCQ-16A team renames the `user_id` field to `account_id` in an Avro record. They add `"aliases": ["user_id"]` to the new `account_id` field and register v2 under the registry's BACKWARD compatibility setting, which accepts it. A consumer still running the v1 schema, where `user_id` is a string with default `"unknown"`, reads messages produced with v2. What does that consumer observe?
MCQ-7A payments service ships `message Charge { int32 id = 1; int64 amount_cents = 2; int32 currency_code = 3; int32 retry_count = 4; }`. A later release deletes `retry_count` and reuses tag 4 for `int32 installment_plan = 4`. A batch job still running the old binary writes a record with `retry_count = 3`. What does a consumer on the new schema report for that record?
MCQ-8`payment.proto` declares `int64 user_id = 3;`. The team renames it to `int64 account_id = 3;` (same number, same type) regenerates stubs and deploys. Binary gRPC clients built against the old schema keep working. Two things break: a mobile client reading the protojson body from the HTTP gateway no longer finds the value, and a Java service compiled against the old stubs throws `NoSuchMethodError` on `getUserId()` after loading the new generated classes. Which explanation fits both failures?
MCQ-21A team ships Protobuf events through a schema registry set to BACKWARD compatibility. Before each deploy, CI replays stored event fixtures through the Java consumers' generated classes. A producer adds field 7, `retry_count`, with a default; the registry check passes and the producer deploys. Within an hour, one of the twelve consumers, a Python service that parses events with `json_format.Parse`, throws `ParseError: Message type "Order" has no field named "retry_count"`. The Java consumers are unaffected. What would have caught this before the deploy?
MCQ-20A Parquet file has a column `event_time` stored as physical INT64 with logical type TIMESTAMP(MILLIS, UTC). A reader that ignores logical annotations prints the raw INT64 value `1700000000` for one row. What should a Parquet-aware reader display for that row?
MCQ-13A Hive table `orders` is backed by Parquet files written without field IDs; each file's footer records the column names as they were at insert time, including `amount`. An engineer renames the column with a metastore-only `ALTER TABLE orders CHANGE COLUMN amount total_amount DOUBLE` and rewrites no files. Afterward, `SELECT total_amount FROM orders` returns NULL for every row, while `SELECT amount FROM orders` fails with 'column not found'. What explains the NULLs?
MCQ-11An Iceberg table `events` holds 40 million rows across 120 Parquet data files. Its schema is `user_id` (field id 1), `event_ts` (field id 2), `payload` (field id 3). Over one week three changes land: `user_id` is renamed to `uid`; `payload` is dropped and re-added with the same name and type; `event_ts` is moved to the first position. No data files are rewritten, so 90 of the 120 files predate all three changes. A job runs `SELECT uid, payload FROM events` over the whole table. What does it return for the rows in those 90 pre-change files?
MCQ-14A Spark job pinned to a Delta client that supports reader version 2 fails on a table whose _delta_log protocol action lists minReaderVersion 3 and readerFeatures ["deletionVectors"]. What is that protocol action telling the client?
MCQ-17A payments team runs PostgreSQL 16. `orders` holds 400M rows and takes ~3,000 inserts/sec. They add a CHECK constraint in one statement, `ALTER TABLE orders ADD CONSTRAINT orders_total_positive CHECK (total_cents > 0);`, and it runs for 41 minutes. Every read and write on `orders` blocks for the whole 41 minutes, the app's 20-connection pool saturates, and p99 goes from 40 ms to 12 s. No row violates the constraint. Which rollout would have added the same constraint without blocking reads and writes?
MCQ-18A Postgres 15 `orders` table holds 800M rows and `coupon_code text` is nullable. The team backfills every NULL, confirms `SELECT count(*) FROM orders WHERE coupon_code IS NULL` returns 0 on the primary, and drains the last `checkout-api` v4.1 pods that omitted the column. The next morning they run `ALTER TABLE orders ALTER COLUMN coupon_code SET NOT NULL;` and it fails with `column "coupon_code" contains null values`. A nightly `bulk-import` job runs at 02:00 and inserts with `INSERT INTO orders (id, total) VALUES ($1, $2)`. What is the correct next step?
MCQ-12A payments service stores `txn.amount_cents`. The team is renaming it to `amount_minor`: they added the new column as nullable, backfilled all 90M rows, and deployed code that writes both columns and reads `amount_minor` with a fallback to `amount_cents`. The rolling deploy of 80 pods takes 15 minutes. Two days later, telemetry shows the fallback path is hit 0 times per hour. Which action completes the migration correctly?
MCQ-15A payments gateway stores capture_window as a required int32 whose Avro doc reads 'milliseconds'. The product allows windows from 60000 (60 s) to 604800000 (7 days), and a 5-minute window is written as 300000. A producer refactor starts writing Duration.ofMinutes(5).toSeconds(), so the same field name and type now carry 300. The subject's compatibility level is BACKWARD, the CI schema diff comes back clean, and both gates pass. Within an hour, 640000 captures fail with window expired: every capture that lands more than 300 ms after the authorization is now out of window. Which change would have failed this release before it shipped?