About this question
Easy · backtesting · Quant Researcher interview question · backtesting, attribution, portfolio, statistics
Return attribution is a core process in quantitative backtesting that decomposes portfolio profit and loss (P&L) into individual asset contributions. A linear attribution model calculates each contribution as the product of an asset's weight and its simple return. The sum of these contributions must reconcile to the total portfolio return, enabling detailed performance analysis. Task Implement the function solution(weights: list, returns: list) -> list to calculate linear return attribution for