Interview › Consecutive dates

SQL interview: customers who ordered 3 days in a row

Three days in a row is an island of length 3, or date, date+1, date+2 as a join.

Prompt. Customers who placed at least one order on three consecutive calendar days.

Hint: Island COUNT(*) >= 3

The self-join version is fine for 3. Islands scale when they say “N days.”

Then write it on a ticket

Monday is free. A colleague asks, you type, we mark it.

Clock in free