The task and original case

Build an event-level inventory ledger that exposes missed demand before replenishment. A positive final stock balance is insufficient evidence that every request was filled. Your task is to show when stock reached zero, how much demand could not be served and what the later receipt changes.

Original practice inputs and intended output
Case elementValue or requirement
InputsStart 12units; successive sales 3,4,5, then demand 2 before an incoming 8.
BuildAn event-level stock ledger and an explanation of unmet demand.

This is an original invented exercise. It is independent practice, with no employer assessment or open-vacancy claim. Download the inputs, attempt your own result, then open the separate answer key.

Build a result another person can follow

Start with twelve units. Process events in order: sales of three, four and five, then a request for two, then a receipt of eight. Keep requested demand, fulfilled units, incoming units and closing stock in separate columns. Under this exercise's rule, unfilled demand is lost rather than automatically backordered.

For each demand event, fulfilled units equal the smaller of requested units and stock available before that event. Unmet demand is the remainder. Closing stock is prior stock minus fulfilled units plus receipts. SQLite window sums can display cumulative movements, but the ledger must retain the fulfillment rule; subtracting all demand and allowing negative physical stock would model a different system.

Sources[1]

Check the worked result

The first three sales reduce stock from twelve to nine, then five, then zero. The next two-unit request is unfilled, producing two unmet units. The eight-unit receipt then leaves eight units on hand. The ledger therefore reports eight closing units and two unmet units.

Do not “repair” the earlier failure because stock is available later. If you instead choose a backorder policy, the receipt could later satisfy the two queued units and leave six; that is a different declared scenario with a different service-time implication.

Make the failure visible

Sort events by a displayed label rather than their sequence and the receipt may incorrectly move before the demand. Give each event a stable sequence or timestamp plus a tie-break rule. Test a demand equal to available stock and one exceeding it by a single unit. Also reject negative requested quantities unless you deliberately introduce a separate return event.

Revise it and ask someone to reproduce it

For revision two, move the receipt before the final demand. Predict the result: all demand can be fulfilled and closing stock becomes six. Ask a peer to compare that timeline with the original and identify which event changed the service outcome. Preserve both ledgers and explain why their final balances alone do not tell the full story.

  • Event order and tie-break rules are explicit.
  • Physical stock never becomes negative under the chosen lost-demand rule.
  • Unmet demand remains visible after a later receipt.

Describe the work accurately

After completing your own version, you could adapt this project bullet: “Built an independent event-level stock ledger that separates fulfillment, unmet demand and replenishment under a stated policy.”

Use Projects or Independent practice as the heading. Keep the input files, result and revision together. Describe only your own completed work; the invented numbers are model outputs, not employer results or measured business impact.