Interview practice question
Distinct users over billions of rows
Data Engineering · SQL · Experienced
A dashboard counts distinct users per day and per month over 50 billion events, and it's too slow and costly. What do you do?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Pre-aggregate daily distinct counts into a small table.
- Monthly distinct can't be summed from daily counts.
- Store HLL sketches per day and merge them for any period.
- Or use approximate count distinct with known error.
- Agree accuracy expectations with stakeholders.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.