How would you handle late-arriving or duplicated data when performing streaming inserts into BigQuery?

Quick Overview

Asks how to keep a BigQuery table correct when streamed events arrive late or more than once. Tests knowledge of ingest-time deduplication options, downstream deduplication with window functions and MERGE, event-time partitioning, lateness windows and correcting downstream aggregates.

How would you handle late-arriving or duplicated data when performing streaming inserts into BigQuery?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

How would you handle late-arriving or duplicated data when performing streaming inserts into BigQuery? Assume events flow from producers through a streaming pipeline into a table that analysts query by event date. ```hint Two separate questions Split the problem: which timestamp decides where a row belongs, and which key decides whether two rows are the same event. ``` ```hint Check the guarantees Look at how long each ingest-time deduplication guarantee actually lasts, and what happens to duplicates created before the write reaches BigQuery. ``` ### Clarifying Questions to Ask - Does every event carry a stable unique ID assigned by the producer? - Are duplicates exact copies, or can the same key arrive again with updated values? - How late can events arrive in practice, and how fresh must the clean table be? - Are there downstream aggregates that must be corrected when late rows land? ### What a Strong Answer Covers - What the ingest-time options guarantee and where those guarantees stop - A downstream deduplication step keyed on a business identifier, and how it stays idempotent - How event-time partitioning and a lateness window keep late rows in the right place - How downstream tables and aggregates are corrected when late data arrives - The cost and freshness trade-offs of the design ### Follow-up Questions - Two versions of the same record arrive out of order. How do you make sure the clean table keeps the right one? - How would you choose the lookback window for the deduplication job, and what happens to an event that arrives after it? - How do you keep the deduplication job cheap as the clean table grows to billions of rows? - How would you detect and alert on a rise in duplicates or late data?

Overview: Asks how to keep a BigQuery table correct when streamed events arrive late or more than once. Tests knowledge of ingest-time deduplication options, downstream deduplication with window functions and MERGE, event-time partitioning, lateness windows and correcting downstream aggregates.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

How would you handle late-arriving or duplicated data when performing streaming inserts into BigQuery? Assume events flow from producers through a streaming pipeline into a table that analysts query by event date.

Clarifying Questions to Ask Guidance

  • Does every event carry a stable unique ID assigned by the producer?
  • Are duplicates exact copies, or can the same key arrive again with updated values?
  • How late can events arrive in practice, and how fresh must the clean table be?
  • Are there downstream aggregates that must be corrected when late rows land?

What a Strong Answer Covers Guidance

  • What the ingest-time options guarantee and where those guarantees stop
  • A downstream deduplication step keyed on a business identifier, and how it stays idempotent
  • How event-time partitioning and a lateness window keep late rows in the right place
  • How downstream tables and aggregates are corrected when late data arrives
  • The cost and freshness trade-offs of the design

Follow-up Questions Guidance

  • Two versions of the same record arrive out of order. How do you make sure the clean table keeps the right one?
  • How would you choose the lookback window for the deduplication job, and what happens to an event that arrives after it?
  • How do you keep the deduplication job cheap as the clean table grows to billions of rows?
  • How would you detect and alert on a rise in duplicates or late data?