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 Analysis with Python (pandas, polars, DuckDB) Module 15

Data-quality checks you can automate interview questions

Interview questions on data-quality checks you can automate: warm-ups, then what each harder question tests and how a good answer starts.

11 questions: 3 warm-ups and 8 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher

    What is the difference between profiling a dataset and checking it?

    Answered in the lesson Data-quality dimensions and checks in code

  2. Fresher to mid

    What does lazy=True change when you validate a DataFrame with pandera?

    Answered in the lesson Schema validation and tests: pandera and pytest

  3. Fresher

    What is a reconciliation table, and what goes in each row?

    Answered in the lesson Reconciliation, audit trails and reproducibility

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

    Every data-quality check on yesterday's orders passed, yet finance says the day's revenue in your report is 18 % too low. How can both be true, and which checks were missing?

    What it tests
    Telling row-level checks from the completeness of a period and from accuracy, reconciling with an outside total, and adding checks with the right severity.
    First step
    Compare like with like before blaming the data: the same day boundary and time zone, the same statuses and the same treatment of refunds as finance. Then count the day's orders hour by hour. A feed that stopped early passes every row-level check and leaves its last hours empty.
    Follow-ups

    From the lesson Data-quality dimensions and checks in code

    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 4 minutes
  2. Senior to staff

    Your team runs 40 data-quality checks on a daily pipeline. They raise about 25 warnings a week, people have stopped reading them, and a real problem went unnoticed for nine days. How do you redesign the checks and their alerts?

    What it tests
    Designing severities, setting thresholds from the history of results, routing alerts to owners, and measuring whether a check is worth keeping.
    First step
    Start from the saved results of past runs: for each check, count how often it warned or failed and how often that led to a fix. Checks that fire often and never lead to action are the noise; the nine-day problem shows which signal was missing or drowned.
    Follow-ups

    From the lesson Data-quality dimensions and checks in code

    Model answer, Pro.

    In the answer:

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

    A cleaning function has 30 passing unit tests, yet last week it turned 2 % of amounts into missing values in production, and nobody noticed for four days. What did the tests miss, and what would you add: more fixtures, a schema check at run time, or property-based tests?

    What it tests
    The gap between example-based tests and production data, run-time schema validation, property-based tests, and where each kind of check belongs.
    First step
    Find the inputs that produced the missing amounts and compare them with the fixtures. Usually they hold a format the fixtures never contained, such as a thousands separator or a currency sign. That names the missing test; the four days name a missing run-time check.
    Follow-ups

    From the lesson Schema validation and tests: pandera and pytest

    Model answer, Pro.

    In the answer:

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

    A partner sends 2 million rows a day, and about 0.3 % fail your pandera schema. Product wants the load to go on. Design what happens to the failing rows, who sees them, and when the load should stop instead.

    What it tests
    Lazy validation at scale, quarantine design, rules for stopping a load, and bringing corrected rows back without counting them twice.
    First step
    Agree on what a failing row costs before designing anything: is a missing payment worse than a late one? Then split each run into rows that pass, rows set aside with their failure cases, and a stop rule, such as more than 1 % failing or any failure in a key column.
    Follow-ups

    From the lesson Schema validation and tests: pandera and pytest

    Model answer, Pro.

    In the answer:

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

    Your analysts maintain pandera schemas for tables that also live in a database. A senior engineer says the rules belong in the database as constraints instead. When is each right, and what do you do with rules that fit neither?

    What it tests
    What constraints and schemas enforce and report, what each costs, rules across tables and over time, and keeping one source of truth for the rules.
    First step
    Sort the rules by kind: keys and required values, allowed values and ranges, rules across a row, rules across tables, and rules about shares, trends or freshness. Each kind has a natural home, and the disagreement is usually about the middle kinds only.
    Follow-ups

    From the lesson Schema validation and tests: pandera and pytest

    Model answer, Pro.

    In the answer:

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

    An auditor picks one order from the source system and asks why it is not in your quarterly revenue report. What must you have kept to answer within minutes, and how do you answer?

    What it tests
    Audit trail design: removed and changed rows with reasons, versioned inputs and rules, and answering one row's history without re-running the pipeline.
    First step
    Look the order up in three places: the inputs of the quarter's run (was it in the extract at all?), the trail of removed rows (which step and rule removed it?) and the trail of changes (did its date or key change, so that it moved?). The run log says which inputs and code that run used.
    Follow-ups

    From the lesson Reconciliation, audit trails and reproducibility

    Model answer, Pro.

    In the answer:

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

    A scheduled job's output file gets a different SHA-256 hash every night, even when its input files are byte for byte the same. How do you tell whether the results really changed, and how do you make the run reproducible?

    What it tests
    The sources of difference between runs (timestamps, row order, unseeded sampling, set order, floating-point order, versions), comparing content instead of bytes, and run logs.
    First step
    Compare the content, not the bytes: load two nights' outputs, sort both by the key and compare them with assert_frame_equal. If they match, the difference is in the file itself, such as a timestamp or the row order; if they do not, look for randomness and for changed versions.
    Follow-ups

    From the lesson Reconciliation, audit trails and reproducibility

    Model answer, Pro.

    In the answer:

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

    For the same month, the CRM reports 48,210 active customers, billing reports 46,955 and your analysis 47,388. Leadership wants one number by the end of the week. Plan the reconciliation: what do you compare, in what order, and what do you report?

    What it tests
    Definitions before data, grain and keys across systems, time windows and test accounts, a reconciliation table between systems, and reporting explained and unexplained differences.
    First step
    Write down each system's definition of an active customer: the event that counts, the time window and its time zone, and what one customer is (a person, an account or a login). Most of the gap usually comes from definitions, and measuring each one in turn gives the first lines of the reconciliation.
    Follow-ups

    From the lesson Reconciliation, audit trails and reproducibility

    Model answer, Pro.

    In the answer:

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

All Data Analysis with Python (pandas, polars, DuckDB) interview questions · The Data Analysis with Python (pandas, polars, DuckDB) 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.