Start by clarifying requirements and assumptions, then outline a modular pipeline: data loading/cleaning, return computation, portfolio aggregation, performance metrics, and testing. Emphasize vectorized pandas operations, documented choices for missing data and outliers, and design trade-offs for rebalancing and scalability.
Pro tip: Proactively discuss how you'd handle non-overlapping dates and NaNs by aligning on a union of dates and forward-filling prices (not returns) before computing returns, and mention that you'd validate with unit tests for edge cases like zero weights and all-NaN columns.
Ask about data frequency, date alignment expectations, missing value handling, outlier definition, rebalancing frequency, and output format. State assumptions explicitly (e.g., prices are adjusted close, dates are trading days).
Outline functions for loading/cleaning, computing returns, aggregating portfolio returns, calculating metrics, and exporting results. Emphasize vectorization and avoiding loops for performance.
Explain how to align dates using outer join, handle missing values (e.g., forward-fill prices, drop leading NaNs), and detect outliers (e.g., z-score or IQR) with documented rationale.
Describe fixed-weight vs. periodic rebalancing logic, compute cumulative and annualized returns, volatility, Sharpe ratio, and max drawdown. Support multiple portfolios via a summary table.
Write unit tests for edge cases (non-overlapping dates, zero weights, NaNs). Analyze algorithmic complexity (e.g., O(T*N) for T dates and N assets) and justify design choices like using pandas for vectorization.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.