CODE WORKSPACE

Interview late-data replay check

Return replay partitions for late or corrected source events.

Start by naming the output grain, then build CTEs that can be inspected one at a time.

Sample input

source_eventsLate arrivals and corrections force replay of their original event-time partition.
event_idevent_timeingested_atis_correction
5022026-03-02 10:00:002026-03-05 09:00:000
5032026-03-03 11:00:002026-03-05 10:00:001
5052026-03-04 14:00:002026-03-06 02:00:000

Expected output

Expected outputOne replay row per affected event-time partition.
partition_dayrecords_to_replaylatest_arrival_at
2026-03-0212026-03-05 09:00:00
2026-03-0312026-03-05 10:00:00
2026-03-0412026-03-06 02:00:00

Constraints

State the output contract first, use readable CTE layers, return the exact columns requested by the prompt, and use deterministic ordering.

Expected skills

Interview clarification, SQL structure, edge-case handling, and final-answer narration.

SQL
Loading...

AI evaluation

Run the SQL query to inspect preview rows.