Python data engineering interview problem. Difficulty: intermediate. Pattern: Sliding Window. About 15 minutes. Part of the Pro drill bank.
A product's daily active flag is a list of 0/1 (or False/True). Retention wants the longest consecutive streak of active days.
Return the longest run of consecutive active days.
Input: longest_active_streak([1, 1, 0, 1, 1, 1]) Output: 3 This input follows the stated rules and produces this output.
Topics: lakebench, python, sliding-window.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Given a list of daily activity flags, find the length of the longest streak of active days.
Return the longest run of consecutive active days.