HARDVerified Real Interview• Financial Analytics Engineer
Rolling 7-Day Cumulative Payout Volume
Verified Source:Public Candidate Interview Report
Stripe's Treasury team monitors rolling 7-day cumulative payout volumes to ensure liquidity reserves.
Write a SQL query using window frames (ROWS BETWEEN) to calculate the 7-day rolling total payout amount for each calendar date.
Return payout_date, daily payout amount (daily_amount), and the 7-day rolling cumulative total (rolling_7d_total).
Sort by payout_date ascending.
Tables:
daily_payouts(payout_dateDATE PRIMARY KEY,amountDECIMAL)
Execution Sandbox:
Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.
Standard SQL (ANSI)|Ln 1, Col 1(7 lines, 118 chars)
Tab Indent⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.