Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 58/ 160
03. Data Warehousing & Data Modeling

Handling Late-Arriving Facts & Late-Arriving Dimensions

Design loads that tolerate delayed events and incomplete dimensions without corrupting history.

AdvancedLate Facts · Late Dims · Reprocessing3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Event, ingestion, and process timestamps. Next, unknown dimension rather than guessed truth. Finally, version, reconcile, and notify consumers.

Think of it like…

Late arrival is a delayed receipt for last month's books: file it by the purchase date, use that month's customer address, and issue a correction rather than counting it as today's sale.

Where you’ve seen it

A 10-day-late order is partitioned on order_date, upserted by order_id, and joined to the customer SCD row valid at checkout; the past 14-day revenue aggregate is atomically reprocessed.

Words you’ll hear

Late Facts
Business events whose event time predates the closed or already published processing partition.
Late Dims
A descriptive entity that becomes known after facts reference its natural key, often represented temporarily by an inferred member.
Reprocessing
Rerunning a bounded affected time/key range using idempotent writes after source truth catches up.
Operational boundary
Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports. Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

Visual diagram

Loading interactive diagram

Theory & deep dive

Late Facts: the working mechanism

Late data arrives after its business event time, so loads need a replay window and deterministic lookup policy for facts whose dimension version or business partition was not known at initial processing.

Event, ingestion, and process timestamps. Unknown dimension rather than guessed truth, then deterministically recompute affected partitions; this exposes the state governed by Reprocessing.

Handling Late-Arriving Facts & Late-Arriving Dimensions in one concrete design

A 10-day-late order is partitioned on order_date, upserted by order_id, and joined to the customer SCD row valid at checkout; the past 14-day revenue aggregate is atomically reprocessed.

Key takeaway: Late data arrives after its business event time, so loads need a replay window and deterministic lookup policy for facts whose dimension version or business partition was not known at initial processing

Handling Late-Arriving Facts & Late-Arriving Dimensions: failure mode and production response

Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports.

Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates. Track Lateness p99 as "inform the replay lookback with observed event delay", and make Lookback visible to the dataset owner.

Key takeaway: Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

How it works, step by step

Step 1 of 4
Late Facts

1. Record both times

Event, ingestion, and process timestamps. Late data arrives after its business event time, so loads need a replay window and deterministic lookup policy for facts whose dimension version or business partition was not known at initial processing.

event, ingestion, and process timestamps
Key numbers at this step
Lateness p99
inform the replay lookback with observed event delay
Late Dims
A descriptive entity that becomes known after facts reference its natural key, often represented temporarily by an inferred member.

When to use it & trade-offs

What it is

Late data arrives after its business event time, so loads need a replay window and deterministic lookup policy for facts whose dimension version or business partition was not known at initial processing. A 10-day-late order is partitioned on order_date, upserted by order_id, and joined to the customer SCD row valid at checkout; the past 14-day revenue aggregate is atomically reprocessed.

Why it matters: Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports. Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

When to reach for it

  • Design loads that tolerate delayed events and incomplete dimensions without corrupting history.
  • Choose Late Facts because it provides this capability: Business events whose event time predates the closed or already published processing partition.
  • Keep evidence for Lateness p99 at "inform the replay lookback with observed event delay" so the last production stage-Publish corrections - version, reconcile, and notify consumers-remains testable.

When to avoid or be careful

  • Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports.
  • Do not conflate Late Dims with Late Facts. The second concept contributes different behavior: A descriptive entity that becomes known after facts reference its natural key, often represented temporarily by an inferred member.
  • Release only after this guardrail is in place: Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

Late Facts / Late Dims / Reprocessing - roles, limits, and operating cost

Late Facts
Best for: Business events whose event time predates the closed or already published processing partition.

Strengths: Business events whose event time predates the closed or already published processing partition. Late data arrives after its business event time, so loads need a replay window and deterministic lookup policy for facts whose dimension version or business partition was not known at initial processing.

Watch out: Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports.

Late Dims
Best for: A descriptive entity that becomes known after facts reference its natural key, often represented temporarily by an inferred member.

Strengths: A descriptive entity that becomes known after facts reference its natural key, often represented temporarily by an inferred member. In this workflow it supports: Replay window - deterministically recompute affected partitions.

Watch out: The operating cost is real: for example 14 days, not an arbitrary last run.

Reprocessing
Best for: Rerunning a bounded affected time/key range using idempotent writes after source truth catches up.

Strengths: Rerunning a bounded affected time/key range using idempotent writes after source truth catches up. Its output can be checked with Correction version.

Watch out: Operating guardrail: Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for Late Facts, and how would Lateness p99 reveal it?”
  • “Why is Late Dims distinct from this behavior: rerunning a bounded affected time/key range using idempotent writes after source truth catches up?”
  • Production clue: Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports.
  • Design probe: Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

Benchmarks & rules of thumb

Lateness p99 -
inform the replay lookback with observed event delay
Lookback -
for example 14 days, not an arbitrary last run
Correction version -
consumers know which aggregate supersedes a prior publication

Common mistakes & follow-ups

Common interview mistakes

  • Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports.
  • Reporting success from a job exit code without checking Lateness p99 and Lookback.
  • Treating this example as complete without replay, rollback, or access boundaries: A 10-day-late order is partitioned on order_date, upserted by order_id, and joined to the customer SCD row valid at checkout; the past 14-day revenue aggregate is atomically reprocessed.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: Business events whose event time predates the closed or already published processing partition.
  • What does the recovery plan do when this occurs? Dropping a late event loses revenue, assigning it today's customer attributes rewrites history incorrectly, and blindly rewriting a closed month can duplicate totals or invalidate published exports.
  • When is Late Facts insufficient for Lookback, and what does adding Late Dims cost in Lateness p99?
Interview tip: Lead with the data path and failure boundary: Late data arrives after its business event time, so loads need a replay window and deterministic lookup policy for facts whose dimension version or business partition was not known at initial processing. Then make the answer operational: Maintain event-time partitions plus processing-time watermarks, an inferred/unknown dimension member, a configured lookback window, and idempotent MERGE/recompute logic with versioned corrections to published aggregates.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Handling Late-Arriving Facts & Late-Arriving Dimensions with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
Semantic Layers & Metrics Stores (dbt Semantic Layer, Cube)
Next topic
Data Archival, Retention Policies & Cold Storage Tiering