Use event time rather than processing time, and define a watermark, which is the engine's heuristic estimate that no events older than a given timestamp will still arrive. Windows close when the watermark passes their end. Set an allowed lateness so slightly late events still update results, and route anything later to a side output or a reconciliation table rather than discarding it silently.
Why interviewers ask this
Late data is where streaming gets genuinely hard, so this question separates people who have run a job in production from those who have completed a tutorial. Interviewers want event time versus processing time, the watermark as a trade off between latency and completeness, and a policy for very late events rather than a shrug.
How to structure your answer
- Distinguish event time from processing time up front.
- Define the watermark and what closing a window means.
- Frame the lateness threshold as a completeness versus latency trade off.
- Give the policy for events past the threshold.
- Mention measuring actual lateness to set the number empirically.
Example answer
First, everything is keyed on event time, because processing time results change every time you replay and that makes them useless for reconciliation. Then the watermark is the engine's claim that it does not expect events older than this timestamp anymore, and windows finalize when it passes them. Choosing that lag is the actual design decision: a short watermark gives you fast results that are sometimes incomplete, a long one gives you correct results late. I set it from data rather than intuition. On a mobile app pipeline we measured the gap between event time and ingestion time and found the ninety ninth percentile was about four minutes, driven by phones being offline, so we set allowed lateness at ten minutes. Anything later went to a side output that fed a daily reconciliation job which corrected the affected windows in the warehouse. The rule I hold to is that late data never gets dropped quietly. If we discard it, it gets counted first.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you choose between updating results and emitting corrections?
- What happens to watermarks when one partition stops receiving data?
- How do you bound state size for long windows?
Related data engineer questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions