Interview practice question
Deduplicating events with late duplicates
Data Engineering · SQL · Experienced
An event stream delivers duplicates, sometimes hours apart, identified by event_id. How do you deduplicate in SQL without rescanning all history each run?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Deduplicate within each new batch first.
- Check new event_ids against recent target data, not all history.
- Use a lookback window based on how late duplicates arrive.
- MERGE with WHEN NOT MATCHED THEN INSERT only.
- Keep a small key table if needed for fast lookups.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.