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 6

TOML 1.1 and other configuration formats interview questions

Interview questions on TOML 1.1 and other configuration formats: warm-ups, then what each harder question tests and how a good answer starts.

13 questions: 4 warm-ups and 9 with model answers · Levels: Fresher to senior

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher to mid

    How do [name] and [[name]] differ in TOML?

    Answered in the lesson TOML essentials: tables and arrays of tables

  2. Fresher to mid

    What did TOML 1.1 change, and does a TOML 1.0 file still read the same?

    Answered in the lesson TOML 1.1, dates, integers and parsers

  3. Fresher to mid

    What goes in the three tables of pyproject.toml, and who reads each?

    Answered in the lesson TOML in practice: pyproject.toml and Cargo.toml

  4. Fresher to mid

    Why can two programs read one .env file differently?

    Answered in the lesson Other config formats: INI, .env and HCL

Questions with model answers

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

  1. Fresher to mid

    A teammate adds a second [server] header near the end of a 300-line TOML settings file, to set one more value, and the service no longer starts. How do you fix the file, and what would stop the next such change before it is merged?

    What it tests
    Knowing the define-once rule, finding every definition of a table, moving keys rather than renaming tables, and catching the mistake in CI with the parser that production uses.
    First step
    Read the error: tomllib names the table and the position, as in Cannot declare ('server',) twice (at line 287, column 8). Then find every definition of that table, which may be a header, dotted keys starting with server. at the root, or an inline table, and move the new key under the first one.
    Follow-ups

    From the lesson TOML essentials: tables and arrays of tables

    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. Mid to senior

    A settings file must describe 40 printers, each with a name, an address and a paper tray. Would you write them as an array of tables, as an array of inline tables, or as one table keyed by printer name? Defend the choice for the code that reads them, for edits and for errors.

    What it tests
    Knowing what each TOML layout builds, how a list and a keyed table differ for lookups, order and uniqueness, how each looks in a diff, and how each fails.
    First step
    Ask how the code finds a printer. If it looks printers up by name, a table keyed by name ([printers.counter]) makes each name unique by itself, because a key or a table is defined once; a list keeps the order but needs its own check for repeated names.
    Follow-ups

    From the lesson TOML essentials: tables and arrays of tables

    Model answer, Pro.

    In the answer:

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

    A Node.js service reads order ids from a TOML file and looks them up in a database. Most lookups work, but order 9007199254740993 is never found, and no error appears anywhere. What happened, and what do you change in the parser call and in the data path?

    What it tests
    Knowing binary64 and the safe-integer limit, TOML's rule that an integer is exact or an error, BigInt and its limits in JSON, and checking the whole path from the file to the database.
    First step
    Print the parsed value next to the text in the file: a parser that returns numbers gives 9007199254740992, a different order. Past 9007199254740991 a JavaScript number cannot hold every integer, so the parser has to return a BigInt or refuse the value.
    Follow-ups

    From the lesson TOML 1.1, dates, integers and parsers

    Model answer, Pro.

    In the answer:

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

    A TOML file gives a sale's start as a local date-time, with no offset, and two services send reminders from it, one in Mumbai and one in Frankfurt. The customers of one service get their reminder hours late. Why, and how do you fix the file and the code?

    What it tests
    Knowing the difference between offset and local date-times, what tomllib and JavaScript's Date make of a local value, and when a local type is the right one.
    First step
    Ask what the value means: one moment for everyone, or a time on each branch's wall clock. A sale that starts at one moment is an instant, so the file needs an offset date-time, which every service reads as the same instant, whatever its time zone.
    Follow-ups

    From the lesson TOML 1.1, dates, integers and parsers

    Model answer, Pro.

    In the answer:

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

    Your command-line tool reads its settings file with tomllib, and its users run Python 3.11 to 3.15. A contributor wants to allow multi-line inline tables, because Python 3.15 reads them. What do you decide, and how do you make the decision stick?

    What it tests
    Knowing which tomllib versions read TOML 1.0.0 and 1.1.0, that the oldest reader decides, and how to hold a format version in CI, in documentation and in error messages.
    First step
    List the readers: the tool runs the tomllib of each user's own Python, and Python 3.11 to 3.14 read TOML 1.0.0 only. While the oldest supported Python reads only TOML 1.0.0, settings files stay TOML 1.0.0.
    Follow-ups

    From the lesson TOML 1.1, dates, integers and parsers

    Model answer, Pro.

    In the answer:

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

    Your release job raises the version in pyproject.toml. A teammate's version of the job reads the file with tomllib, changes the version and writes the file again with a TOML writer, and the release diff shows six lines gone and two comments lost. Design a bump that changes one line, and prove that it did.

    What it tests
    Knowing that a writer from data cannot keep comments or layout, the choice between a style-preserving library and a checked line edit, and proving an edit by comparing parsed data and the text diff.
    First step
    Separate the two things the job must keep: the data, which tomllib can compare, and the text, which only a diff shows. Then change the text, not the data: one version line inside [project], found by tracking the current table, or an edit through a style-preserving library such as TOML Kit.
    Follow-ups

    From the lesson TOML in practice: pyproject.toml and Cargo.toml

    Model answer, Pro.

    In the answer:

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

    A settings export arrives as JSON, with null values in tables and inside arrays, and a tool needs it as TOML. What do you do with each null, and how do you show that the conversion lost nothing that matters?

    What it tests
    Knowing that TOML has no null, the difference between nulls in tables and in arrays, top-level rules of a TOML document, and making a lossy conversion visible and testable.
    First step
    Ask the tool's owner what a missing key means to it. If a missing key means the same as null, leave such keys out and list every path you left out; if not, the export needs a value or a sentinel agreed with the tool. A null inside an array cannot be dropped without moving the items after it.
    Follow-ups

    From the lesson TOML in practice: pyproject.toml and Cargo.toml

    Model answer, Pro.

    In the answer:

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

    A database password contains a #, a $ and a space. It works when Docker Compose reads the .env file, but a shell script that sources the same file and a Kubernetes Secret made from it with kubectl both get a different password. Explain each failure and fix it without weakening the password.

    What it tests
    Knowing that .env has no specification, how a shell, kubectl and Compose each treat quotes, # and $, and moving a secret to a channel with one reading.
    First step
    Write down what each reader received, character by character, without printing the secret in logs: compare its length and a hash with the intended one. Then explain each difference from that reader's documented rules: a shell expands $ and splits on spaces, kubectl keeps quotes.
    Follow-ups

    From the lesson Other config formats: INI, .env and HCL

    Model answer, Pro.

    In the answer:

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

    A new service needs a configuration file that developers edit by hand for local runs and that a CI job generates for each environment. Choose between TOML, YAML, JSON and HCL, and defend the choice, including how you check the file.

    What it tests
    Weighing comments, types, nesting and one reading everywhere against who writes the file, and checking a config after parsing with a schema whatever the format.
    First step
    List the writers and readers: people for local runs, a CI job for each environment, and the service's own parser. Then list what the data needs, such as types, times, nesting depth and computed values, and rule out the formats that fail a need before comparing the rest.
    Follow-ups

    From the lesson Other config formats: INI, .env and HCL

    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.