Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Data Formats (JSON, YAML, TOML, XML, CSV) Module 10

Across formats: time, conversion, streaming, evolution, binary interview questions

Interview questions on “Across formats: time, conversion, streaming, evolution, binary”.

15 questions: 5 warm-ups and 10 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher to mid

    How should an API send a timestamp in JSON, and why?

    Answered in the lesson Dates and times across data formats

  2. Fresher to mid

    Why can a conversion between two formats lose data even when both converters work?

    Answered in the lesson Converting between formats without losing data

  3. Fresher to mid

    What is the difference between parsing a document whole and streaming it?

    Answered in the lesson Streaming large JSON, XML and CSV files

  4. Fresher to mid

    What do backward and forward compatibility mean for a schema change?

    Answered in the lesson Schema evolution: change formats safely

  5. Fresher to mid

    When does a binary format beat JSON?

    Answered in the lesson Beyond text: CBOR, MessagePack, Protobuf, Parquet

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Mid to senior

    A partner's JSON feed sends order times without an offset. Your daily totals look right, but orders placed late in the evening sometimes land on the next day. What happened, and how do you fix the feed and the rows already stored?

    What it tests
    Recognising a lost offset from its symptoms, finding the zone the sender meant, repairing stored instants without guessing, and making the contract refuse times without an offset.
    First step
    Compare a few stored orders with the partner's own records. If the gap is always the partner's offset, such as 5 hours 30 minutes, the feed's local times were read as UTC. Then get the partner to state in writing which zone their clock uses.
    Follow-ups

    From the lesson Dates and times across data formats

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Senior to staff

    Design how a booking service stores and returns appointment times for clinics in India, the United Kingdom and the United States, including bookings made months ahead. What do you store, and what does the API return?

    What it tests
    Separating instants from booked local times, choosing zone names over offsets for future events, and handling gaps, overlaps and rule changes in the API.
    First step
    Split the times into two kinds. Moments that have happened, such as when a booking was made, are instants. The appointment itself is a local time that a patient expects at one clinic, so store it as the local time plus the clinic's IANA zone, not as an instant.
    Follow-ups

    From the lesson Dates and times across data formats

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  3. Mid to senior

    An XML-to-JSON gateway has run for months. Today a consumer crashed on an order whose item field arrived as an object instead of an array. Why only today, and how do you make the mapping safe for every consumer?

    What it tests
    Recognising the array-of-one trap, fixing the mapping from the schema rather than from samples, and protecting consumers while the gateway changes.
    First step
    Look at the order that crashed: it has exactly one item element, and every earlier order had two or more. The convention turns a repeated name into an array and a single one into an object, so the field's shape followed the data, not the schema.
    Follow-ups

    From the lesson Converting between formats without losing data

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Senior to staff

    You must move 2,000 service configuration files from YAML to JSON without changing what any service reads. How do you convert them, and how do you prove that nothing changed?

    What it tests
    Knowing what YAML holds that JSON does not, choosing the loader's schema, and proving equivalence with a loss report and a round trip before any service switches.
    First step
    Scan all 2,000 files for what JSON cannot hold: .inf and .nan, keys that are not strings, anchors and merge keys, custom tags, several documents in one file, and plain scalars that a YAML 1.1 loader types differently. Each kind of finding needs a rule before any file is converted.
    Follow-ups

    From the lesson Converting between formats without losing data

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  5. Mid to senior

    A nightly job that totals sales from a 6 GB JSON export is killed for running out of memory. The export is one big array of orders. What do you change, and how do you show that the job now runs within a fixed memory budget?

    What it tests
    Estimating the memory of a whole-document parse, choosing a streaming reader or format, and proving a flat memory profile with a measurement rather than a hope.
    First step
    Measure the parse on a sample: the lesson's run took about six times the file's size for a JSON array, so 6 GB would need roughly 36 GB. That rules out any whole-document parser, so the job must read one order at a time.
    Follow-ups

    From the lesson Streaming large JSON, XML and CSV files

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  6. Mid to senior

    A streamed import of product prices shows a garbled rupee sign in about one row in four thousand, always a different row, and the source file is fine. What is the bug, and how do you fix it and prove the fix?

    What it tests
    Recognising a chunk-boundary decoding bug from its symptoms, fixing it with one incremental decoder, and testing every cut position instead of one sample file.
    First step
    The rows change between runs and the file is fine, so the damage happens while reading. A multi-byte character cut by a chunk boundary fits: a decoder made per chunk turns its pieces into replacement characters without an error. Check how the import decodes its chunks.
    Follow-ups

    From the lesson Streaming large JSON, XML and CSV files

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  7. Senior to staff

    An order event is read by 12 services owned by different teams. You must add a required currency field without stopping any of them, and some orders sit in queues for up to three days. Plan the rollout.

    What it tests
    Splitting a change that is compatible in one direction into steps that are compatible in both, ordering consumers and producers, and knowing when old data is truly gone.
    First step
    Classify the change first: a new required field is forward compatible only, because new readers would refuse old orders. So it cannot ship as one step. Make it optional with a documented default for every consumer before any producer depends on it.
    Follow-ups

    From the lesson Schema evolution: change formats safely

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  8. Mid to senior

    Your team's JSON message schemas all use additionalProperties false, to catch typos. What does that cost when the format evolves, and how would you change it without breaking current clients?

    What it tests
    Seeing that closed schemas turn additions into breaks, knowing the must-ignore policy, and opening a schema in a compatible order while keeping typo detection somewhere else.
    First step
    Work out what an addition does today: with additionalProperties false, every new member is refused by every reader on the previous version, so each addition needs every reader upgraded first. Opening a schema is itself a change to classify before you make it.
    Follow-ups

    From the lesson Schema evolution: change formats safely

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  9. Mid to senior

    A mobile app uploads telemetry as JSON batches of about 40 KB, compressed with gzip, over slow connections. The team proposes Protocol Buffers to cut data costs. How do you decide, and what numbers do you need first?

    What it tests
    Measuring before switching, comparing raw and compressed sizes on real batches, and weighing schema management, debugging and parsing cost against the bytes saved.
    First step
    Take a few hundred real batches and encode each as compact JSON and as Protocol Buffers, then compress both with the same gzip setting the app uses. The traffic is already compressed, so the compressed sizes, not the raw ones, decide the data saving.
    Follow-ups

    From the lesson Beyond text: CBOR, MessagePack, Protobuf, Parquet

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  10. Senior to staff

    An analytics team stores a day's events as JSON Lines, about 200 GB a day with 60 fields, and most queries use 3 of them. Recommend a storage format and layout, and explain the trade-offs.

    What it tests
    Matching row and columnar formats to write and read patterns, sizing the saving from columns read, and planning row groups, partitions and schema changes.
    First step
    Separate the write path from the read path. Events arrive one at a time, which suits a row format; queries read 3 of 60 columns over many rows, which suits a columnar file. So keep a row format for arrival and convert finished batches to a columnar format for querying.
    Follow-ups

    From the lesson Beyond text: CBOR, MessagePack, Protobuf, Parquet

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All Data Formats (JSON, YAML, TOML, XML, CSV) interview questions · The Data Formats (JSON, YAML, TOML, XML, CSV) track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.