Compute Time-Weighted Return for a Fund With Daily Cash Flows

Last updated: November 29, 2026

Quick Overview

Given daily start market value, end market value and external cash flow for an account, compute its cumulative time-weighted return in pandas, and explain why it differs from the money-weighted return.

BlackRock
Data Manipulation (SQL/Python)
Data Scientist
BlackRock
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given daily start market value, end market value and external cash flow for an account, compute its cumulative time-weighted return in pandas, and explain why it differs from the money-weighted return.

Performance attribution and reporting for BlackRock funds and Aladdin clients depend on returns that neutralize client deposits and withdrawals. The interviewer checks that the candidate places the flow correctly in the denominator, chains daily returns geometrically, and can explain TWR versus IRR to a portfolio manager.

What the Interviewer Expects
  • Adjusts the denominator for the timing convention of the flow
  • Chains daily returns multiplicatively, not additively
  • Validates sorted dates and non-positive capital
  • Explains when TWR and money-weighted return diverge
  • Mentions fees and gross versus net returns
Key Topics to Cover
time-weighted return
pandas
geometric linking
performance measurement
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you handle a flow that arrives at end of day instead of start?
  • How would you annualize a return over 17 months?
  • Why do GIPS standards prefer TWR for composites?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Columns date, start_mv, flow, end_mv. I ask when the flow happens. If the flow arrives at the start of the day it is invested for the whole day, so the day's capital is start_mv + flow. If it arri...

Approach

Daily return rt=EtSt+Ft−1r_t = \frac{E_t}{S_t + F_t} - 1. Cumulative TWR is ∏t(1+rt)−1\prod_t (1 + r_t) - 1. This removes the effect of how much money the client added and when, which is what a manager controls: the re...


Submit Your Answer
Markdown supported

Related Questions