> ## Content Index
> Fetch the complete content index at: https://abundance.alloconomy.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Periodic snapshots remember the quiet days
- URL: https://abundance.alloconomy.com/alloconomy/de-interview-periodic-snapshots-remember-the-quiet-days/
- Published: 2026-11-22T05:09:48.000Z
- Updated: 2026-11-22T16:30:56.000Z
- Description: At Tuesday close a product has eight copies on hand.
- Author: Sathya Narayanan
- Tags: Alloconomy, Data Engineering, Data Engineering Interview Field Guide, #web-only, #series-detail, #Import 2026-11-21 19:23, The three fact table designs

1. [Collection · 10 seriesThe Data Engineering Interview Field Guide](https://abundance.alloconomy.com/alloconomy/data-engineering-interview-field-guide/)
2. [Series opening · 3 essaysThe three fact table designsSeries 2 of 10](https://abundance.alloconomy.com/alloconomy/de-interview-transaction-facts-remember-occurrences/)
3. This essay2 of 3

Data engineering · 3 essays

The three fact table designs

Complete reading path · You are in Part 2 of 3
1. Part 1[Transaction facts remember occurrences](https://abundance.alloconomy.com/alloconomy/de-interview-transaction-facts-remember-occurrences/)Two real parcels each contain three copies.
2. Part 2**Periodic snapshots remember the quiet days**Current essayAt Tuesday close a product has eight copies on hand.
3. Part 3[Accumulating snapshots remember milestones](https://abundance.alloconomy.com/alloconomy/de-interview-accumulating-snapshots-remember-milestones/)Line A was accepted Friday, partially dispatched Saturday, fully dispatched Monday, and reopened Wednesday for a replacement.

## The interview prompt

At Tuesday close a product has eight copies on hand. Wednesday’s extract is absent. Thursday closes at five. The buyer asks for Wednesday closing stock, the month-end balance, and average daily stock. Which answers can the model support?

## A snapshot needs a population and a cutoff

Write one row per stocked product, location, and local close. Record the snapshot status and the scope of the completed extract. If Wednesday had a confirmed opening of eight and a complete movement log with two dispatches and one receipt, the inferred close is seven. Mark it as reconstructed and reconcile to Thursday using Thursday’s movements. Without the movements, the endpoints do not determine Wednesday’s quantity.

For month-end, use the balance at the required close, or an explicit roll-forward under a documented policy. A query that takes the maximum quantity in the month finds a peak. A query that takes the last row may silently use a Tuesday for one store and a Thursday for another. Line up the cutoffs before combining them.

If Tuesday, Wednesday, and Thursday are the *entire* reporting period and their closes are 8, 7, and 5, the mean of daily closes is 20/3, or about 6.67 copies. That is distinct from a time-weighted average intraday stock, which needs quantities and durations between changes. If Wednesday remains unknown, report coverage alongside any estimate. Averaging only the two observed days answers a different sampling question.

## The model behind the answer

Nobody touches the school’s order on Sunday. Maya still owes two books. A periodic snapshot can store one row per eligible order line at each local day-end, including days with no movement. Define the population explicitly. For this example, include open lines and retain one closing row on the day a line is fulfilled.

The Friday-through-Monday closing quantities are 6, 2, 2, and 0\. Add the open units across different lines at Sunday close to size Monday’s workload. Adding those four daily balances gives 10 **unit-days** of closing backlog, a different measure from books owed at any single close. A daily shipment measure stored alongside the balance would have its own aggregation rule.

If Sunday’s extract fails, leave its completeness in doubt until you can reconstruct it. An observed balance of zero, a line outside the population, and an overdue feed have different meanings. [Stocks vs. Flows](https://abundance.alloconomy.com/alloconomy/the-clock-inside-every-number/) · [Kimball on periodic snapshots](https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/kimball-techniques/dimensional-modeling-techniques/periodic-snapshot-fact-table/?ref=abundance.alloconomy.com)

## Try it in SQLite

Watch backlog on a quiet Sunday

Predict Sunday before running the query. Change Monday’s dispatched quantity from two to one in a query to see which closing balances change.

Tables and sample dataExample query Your SQL

Run SQLStopReset example

Each run starts with fresh sample data. Use Ctrl+Enter or ⌘+Enter to run. Only your browser processes the query.

Label Measure 

## Review what a backfill leaves unknown

Have the agent draft a Wednesday backfill from Tuesday’s eight and Thursday’s five. Give the reviewer a Wednesday shipment of two and receipt of one. Before running it, ask whether those are all the movements and whether both extracts cover the same location and cutoff.

**Reviewer decision.** With a complete movement log, Wednesday closes at seven. With an unsealed log, the certified balance stays unknown. Inspect the filled value, provenance and status together. A forward-fill of eight might be acceptable in a separately labelled estimate. It cannot certify the missing close.

*Further reading.* [The Data Warehouse Toolkit](https://www.amazon.com/dp/1118530802?ref=abundance.alloconomy.com), 3rd ed., on periodic observations and their population.

## One more question

A shop starts carrying the book on Thursday. Should you emit zero balances on Tuesday and Wednesday?

Check your reasoning

Decide whether the population is every possible title or the assortment actively carried at each store. Under an active-assortment contract those earlier days are outside scope. An in-scope title confirmed out of stock earns a zero. This distinction changes both availability rates and their denominator.

1. [Back to the series openingThe three fact table designsSeries 2 of 10](https://abundance.alloconomy.com/alloconomy/de-interview-transaction-facts-remember-occurrences/)
2. [Explore the collectionThe Data Engineering Interview Field Guide](https://abundance.alloconomy.com/alloconomy/data-engineering-interview-field-guide/)

[Previous · Transaction facts remember occurrences](https://abundance.alloconomy.com/alloconomy/de-interview-transaction-facts-remember-occurrences/) · [Next · Accumulating snapshots remember milestones](https://abundance.alloconomy.com/alloconomy/de-interview-accumulating-snapshots-remember-milestones/) · [Complete series map](https://abundance.alloconomy.com/alloconomy/data-engineering-interview-field-guide/)