
142
DA3 Consecutive Purchase Days — Senior-Level SQL Problem
Counting purchases is easy.
Finding a 3-day consecutive streak? That’s interview hard 👀
This isn’t about totals.
It’s about detecting patterns in time-series data.
The trick most candidates miss 👇
✔ Use ROW_NUMBER()
✔ Subtract it from the date
✔ Group by the derived key
✔ Count streak length
This question tests:
🔹 Advanced window functions
🔹 Temporal logic
🔹 Pattern detection skills
🔹 Real product analytics thinking
Streak problems are common in e-commerce, gaming, and fintech interviews 🔥
If you can solve this confidently, you’re operating above average.
#SQLInterview
#AdvancedSQL
#WindowFunctions
#DataAnalytics
#DataEngineering
@dataengnotebook










