Python data engineering interview problem. Difficulty: intermediate. Pattern: Sliding Window. About 15 minutes. Part of the Pro drill bank.
A store reports daily sales. Planning wants the 3-day window with the highest total so they can staff the peak.
Find the window of length k with the largest sum of sales.
Input: best_window_sum([1, 4, 2, 10], 2) Output: 12 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 daily sales figures, find the 3-day consecutive window with the highest total.
Find the window of length k with the largest sum of sales.