Pinduoduo·Software Engineer·Technical Phone Screen
- Given a table with user_id and login_date, calculate the number of consecutive login days each user has within any 15-day rolling window.
“My first instinct was to just do a self-join on the date range and count rows, but that doesn't actually capture the 'consecutive' part properly.”