Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Rolling Average Capital Calls
00:00
5 left

Rolling Average Capital Calls

MediumSQL · PostgreSQL

Problem

Write a query to calculate the rolling three-month average of capital calls for a specific subset of private equity funds.

Use active North American buyout funds from the provided data. Calculate total capital calls by calendar month, treating months without capital calls as zero. The rolling average should use the current month and up to the two preceding calendar months.

Output

  1. One row per calendar month in the selected funds' call-date range
  2. Columns: month, monthly_capital_calls, and rolling_three_month_average
  3. Include months with no calls, ordered by month ascending

Schema

funds
ColumnTypeDescription
fund_idPKINTUnique fund identifier
fund_nameVARCHAR(150)Fund name
strategyVARCHAR(50)Private equity investment strategy
statusVARCHAR(30)Current fund status
regionVARCHAR(50)Primary investment region
capital_calls
ColumnTypeDescription
capital_call_idPKINTUnique capital call identifier
fund_idINTReferenced fund identifier
call_dateDATEDate the capital call was issued
call_amountDECIMAL(14,2)Capital call amount in millions of dollars
Tablesfundscapital_calls
Interviewer

Your question is Rolling Average Capital Calls. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.