Industry-Neutralize an Alpha Vector to a Unit Gross Book

Last updated: November 29, 2026

Quick Overview

Given raw alpha values per ticker and each ticker's industry, produce portfolio weights that net to zero inside every industry and whose absolute values sum to one.

Worldquant
Coding & Algorithms
Quantitative Researcher
Worldquant
November 29, 2026
Quantitative Researcher
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given raw alpha values per ticker and each ticker's industry, produce portfolio weights that net to zero inside every industry and whose absolute values sum to one.

Neutralization by market, sector or industry is a standard simulation setting on WorldQuant BRAIN, used so an alpha's returns come from stock selection rather than an industry bet. The interviewer wants clean code plus an understanding of what neutralizing does to risk and what it cannot fix.

What the Interviewer Expects
  • Demeans within each industry group, not across the whole universe
  • Drops tickers with missing signal or unknown industry
  • Handles a group with a single name (cannot be hedged within the group)
  • Scales to unit gross after demeaning
  • Explains why neutralization reduces factor exposure and what remains
Key Topics to Cover
Group demeaning
Normalization
Risk neutrality
Hash maps
Portfolio construction
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you neutralize against several continuous factors (beta, size) instead of a categorical industry?
  • Add a cap of 5% per name. Is that always feasible with net zero and unit gross?
  • What happens to turnover when industry classifications change?
Sharpen Your Skills on Codemia

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

Practice DSA Problems
Sample Answer
Requirements

Input: dict ticker to raw value (None for missing), dict ticker to industry. Output: dict of weights, each industry summing to 0 and total absolute weight 1. A zero signal everywhere returns all zeros...

High-Level Design

Group valid tickers by industry, subtract the group mean from each value, then divide everything by the total absolute weight. Subtracting the mean is the least squares projection onto the space ortho...


Submit Your Answer
Markdown supported

Related Questions