Process CSV for portfolio returns and metrics
Company: DRW
Role: Machine Learning Engineer
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Take-home Project
Given one or more CSV files containing daily asset prices or returns and optional portfolio weights, write Python (pandas) code to: a) load, clean, and align by date; b) handle missing values and outliers with documented choices; c) compute individual asset returns (simple and log) from prices if needed; d) compute a time series of portfolio returns given weights, supporting fixed-weight and periodic rebalancing; e) calculate cumulative return, annualized return, annualized volatility, Sharpe ratio (risk-free rate provided), maximum drawdown, and rolling-window metrics; f) support multiple portfolios and output a tidy summary table plus a CSV of metrics and a plot-ready time series; g) ensure numerical stability, clear function boundaries, and unit tests for edge cases (non-overlapping dates, zero weights, NaNs); h) report algorithmic complexity and justify design choices.
Quick Answer: This question evaluates a candidate's competency in time-series data manipulation, financial return computation, portfolio analytics, numerical stability, modular software design (clear function boundaries and unit tests), and algorithmic complexity analysis within the Data Manipulation (SQL/Python) domain.