Intermediate
Open
Pro
Interview Round: Top-N per Group, Nth Highest, Streaks
Answer as you would at a whiteboard, stating tie-handling explicitly.
- Return each country's top 2 users by total paid revenue.
- Return the third-highest distinct order amount; return
NULLif there is no such value. Show two approaches and say how they differ on ties. - Find users who placed a paid order on at least 4 consecutive
calendar days, with the start date of each such streak. Explain the
date - row_numbertrick with a tiny example.
Share this question