A 10,000-row table reports 8,400 when you count one column's values — what are those two numbers, and what does their difference measure?
answer
- two numbers, not one
- shape of the table against contents of a column
- subtract them, column by column
- the difference is the hole census
- zero difference still misses stand-in codes
basics
~20 sThey answer different questions. The row count is how many records the table holds; the count of present values is how many of them recorded something in that column. The difference, 1,600, is that column's number of holes.
solid answer
~50 sTwo surfaces, two populations. The row count is a property of the table's shape and never looks inside a cell; the count of present values walks one column and counts only the cells that actually hold a value. Subtract one from the other per column and you have a hole census for the whole table — the cheapest absence audit there is, and it costs a single pass. The pair also sets up every later surprise, because an aggregate that steps over the holes computes over the second number while whoever reads the result assumes the first. The converse is the part candidates miss: a difference of zero proves only that nothing is *encoded* as absent. A stand-in code, an ordinary in-range value a producer wrote to mean "no reading", is a present value and is counted as one.
go deeper
Know that two different counts exist and that they answer different questions. Be able to say which one shrinks when cells record nothing, and that the gap between them is the number of holes in that column.
Explain that the count of present values comes from the tool's own record of which cells hold something, and that subtracting it from the row count gives a per-column hole census for the price of one pass over the data.
Make the pair a reflex on data you did not produce, and say why a zero difference is only a lower bound on incompleteness: stand-in codes and placeholder text pass every absence check as genuine data.
Decide whether the completeness census is an artefact every pipeline run emits rather than something people type ad hoc, and what the team is expected to do when a column's completeness moves between two runs.
## Two counts, and what each is a property of A table's **row count** is a property of its shape: how many records it holds. It is computed without looking inside any cell, and nothing about the contents changes it. A column's **count of present values** is a property of that one column's contents: how many of those records actually recorded something for that field. The tool derives it from its own record of which cells hold a value — whatever mechanism it uses to mark absence — and reports how many do. For a table of 10,000 rows whose `amount` column reports 8,400 present values, the arithmetic is the whole story: **1,600 records have a hole in `amount`**. Those rows have not gone anywhere. They are still in the table, they still take part in a filter, a sort or a match on a key, and they still show up in the row count. They simply recorded nothing for that one field. The **absence test** — the predicate that asks, cell by cell, whether a value is absent — is the mechanism underneath. Counting the cells for which it answers false is the count of present values; counting the rows ignores it entirely. ## Why the pair is the cheapest audit you have - It costs **one pass** over the data and needs no configuration. - Run per column, the shortfalls are a **hole census**: which fields the producer actually fills and which are aspirational. - The census is comparable **across runs**. A column that was complete last month and is three percent short today is a change in an upstream system, not in your code. - It pre-empts the denominator problem, which is the next thing an interviewer asks about. - It tells you where a **shared population** will be needed later: two columns with holes on different rows cannot be folded into one statistic without somebody choosing the rows. The pairing matters because tools name these two surfaces almost identically — a length or size of the table against a count of a column's values — and the two sit one keystroke apart. Reading a review diff you frequently cannot tell which of the two numbers a report is quoting, and they agree exactly on every test fixture that happens to have no holes in it. ## What the difference proves, and what it does not | You observe | You may conclude | You may not conclude | |---|---|---| | present count below the row count | that column has holes, and exactly how many | anything about why they are missing | | present count equal to the row count | nothing in the column is *encoded* as absent | that the column is fully measured | | two columns short by the same amount | each has the same number of holes | that the holes fall on the same rows | The middle row is the one that separates someone who has read about absence from someone who has cleaned another team's extract. A **stand-in code** is a present value. Placeholder text is a present value. A measured zero is a present value and should be. Counting present values detects only the absence the tool itself encoded, so the count is a **lower bound** on the column's incompleteness, and the gap between that bound and the truth is precisely the part no automated check will find for you. The last row matters for anything that reads two columns at once. Absence is recorded per cell, not per record: two columns can each be 1,600 short and overlap on none of those rows, on all of them, or anywhere between. ## Worked On a 10,000-row table: 1. `spend` reports 9,100 present values, so it has 900 holes. 2. `visits` reports 8,700 present values, so it has 1,300 holes. 3. Rows that recorded **both** lie somewhere between 7,800 and 8,700 — the two column counts alone do not pin it down, and only a per-row check finds the real number. Step 3 is the habit worth forming. The per-column counts are not enough to tell you how many complete records you have, which is why a completeness report generally carries both the per-column counts and the count of rows complete across the fields that actually matter to the question. ## In an interview Name both numbers, say which is the larger and why, and say what the difference is. Then add the caveat before you are asked — equality proves only the absence of *encoded* holes — and finish with the practical use: this is the pair you check before you believe any average computed from data you did not produce.
- Why can the count of present values differ between two columns of the same table?Absence is recorded per cell, not per record. One record can report one field and not another, so every column has its own hole set and its own count. That is exactly why a statistic reading two columns has no single population unless somebody forces one.
- What does a difference of zero fail to rule out?Producer-written stand-in codes — in-range values meaning "no reading" — and placeholder text. They are ordinary present values, so the absence test answers false for them and they are counted. The column looks complete while a share of its values are not measurements at all.
- How would you turn this into something a pipeline reports rather than something you type?Emit both numbers per column as an artefact of each run and compare against the previous one. The absolute completeness is rarely the interesting signal; the change in completeness between runs is, because it points at an upstream system rather than at your transform.
saying these in an interview costs you the question
- Says counting a column tells you how many rows the table has
- Assumes the two numbers always agree, so never checks them
- Treats a difference of zero as proof the column is complete
- Calls the row count the denominator of every average
- Assumes an in-range stand-in code is excluded from the count of present values
- Thinks rows with a hole have been removed from the table