HARDVerified Real Interview• Financial Analytics Engineer

Rolling 7-Day Cumulative Payout Volume

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_date DATE PRIMARY KEY, amount DECIMAL)

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
⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.