← 返回博客列表 Millennium OA 真题解析:Quant Intern 数学 + 编程双重考核|2026
Millennium

Millennium OA 真题解析:Quant Intern 数学 + 编程双重考核|2026

2026-05-12

Millennium Management 是全球顶级多策略对冲基金,管理资产超过 600 亿美元。其 Quant Intern OA 独特之处在于数学推理与编程能力并重——不仅考察算法,还涉及概率论、统计学和金融数据处理。本文基于一亩三分地最新面经,系统拆解 Millennium OA 的核心考点。

Millennium OA 概览

维度 详情
平台 HackerRank
时长 90 分钟
题量 3-4 道(数学 + 编程混合)
难度 Medium-Hard
考察重点 概率、统计、Pandas、算法

题型一:概率与数学推理

题目:期望收益计算

一个交易策略每天有 p 的概率盈利 a 元,(1-p) 的概率亏损 b 元。如果连续亏损 k 天则停止交易。求该策略的期望总收益。

def expected_profit(p, a, b, k):
    """
    p: 每天盈利概率
    a: 盈利金额
    b: 亏损金额
    k: 连续亏损k天停止
    """
    # dp[i] = 当前连续亏损i天时的期望未来收益
    # dp[k] = 0 (停止)
    # dp[i] = p * (a + dp[0]) + (1-p) * (-b + dp[i+1])
    
    # 从 dp[k-1] 开始反向计算
    dp = [0] * (k + 1)
    
    for i in range(k - 1, -1, -1):
        # dp[i] = p * (a + dp[0]) + (1-p) * (-b + dp[i+1])
        # 需要迭代求解,因为 dp[0] 出现在等式右边
        pass
    
    # 使用代数方法直接求解
    # 设 dp[0] = x
    # dp[i] = p*(a+x) + (1-p)*(-b + dp[i+1])
    # dp[k-1] = p*(a+x) + (1-p)*(-b)
    # dp[k-2] = p*(a+x) + (1-p)*(-b + dp[k-1])
    # ...
    
    # 递推关系: dp[i] = p*(a+x) + (1-p)*(-b + dp[i+1])
    # 令 c = p*a - (1-p)*b (每天的期望收益)
    # dp[i] = p*x + c + (1-p)*dp[i+1]
    
    # 从后往前计算(用x表示)
    # dp[k] = 0
    # dp[k-1] = p*x + c
    # dp[k-2] = p*x + c + (1-p)*(p*x + c)
    # ...
    
    # 通项: dp[i] = (p*x + c) * sum((1-p)^j for j=0..k-1-i)
    # dp[0] = x = (p*x + c) * sum((1-p)^j for j=0..k-1)
    
    q = 1 - p
    geo_sum = (1 - q**k) / (1 - q) if q != 1 else k
    
    c = p * a - q * b
    # x = (p*x + c) * geo_sum
    # x = p*geo_sum*x + c*geo_sum
    # x(1 - p*geo_sum) = c*geo_sum
    
    denominator = 1 - p * geo_sum
    if abs(denominator) < 1e-10:
        return float('inf') if c > 0 else float('-inf')
    
    return c * geo_sum / denominator

题目:骰子概率

投掷 n 个公平骰子,求恰好有 k 个骰子点数大于 4 的概率。

from math import comb

def dice_probability(n, k):
    """
    n个骰子中恰好k个点数>4的概率
    P(X>4) = 2/6 = 1/3
    """
    p = 1/3  # P(single die > 4)
    q = 2/3  # P(single die <= 4)
    
    return comb(n, k) * (p ** k) * (q ** (n - k))

题型二:Pandas 数据处理

题目:交易数据分析

给定一个交易数据 DataFrame,计算每个交易员的 Sharpe Ratio 和最大回撤。

import pandas as pd
import numpy as np

def calculate_metrics(trades_df):
    """
    trades_df columns: ['trader_id', 'date', 'pnl']
    返回每个交易员的 Sharpe Ratio 和 Max Drawdown
    """
    results = []
    
    for trader_id, group in trades_df.groupby('trader_id'):
        group = group.sort_values('date')
        daily_pnl = group['pnl'].values
        
        # Sharpe Ratio (annualized)
        mean_return = np.mean(daily_pnl)
        std_return = np.std(daily_pnl, ddof=1)
        sharpe = (mean_return / std_return) * np.sqrt(252) if std_return > 0 else 0
        
        # Max Drawdown
        cumulative = np.cumsum(daily_pnl)
        running_max = np.maximum.accumulate(cumulative)
        drawdowns = running_max - cumulative
        max_drawdown = np.max(drawdowns)
        
        results.append({
            'trader_id': trader_id,
            'sharpe_ratio': round(sharpe, 4),
            'max_drawdown': round(max_drawdown, 2),
            'total_pnl': round(sum(daily_pnl), 2)
        })
    
    return pd.DataFrame(results)

题目:时间序列异常检测

def detect_anomalies(price_df, window=20, threshold=2.5):
    """
    price_df columns: ['timestamp', 'price']
    使用滚动均值和标准差检测价格异常
    """
    price_df = price_df.sort_values('timestamp').copy()
    
    price_df['rolling_mean'] = price_df['price'].rolling(window).mean()
    price_df['rolling_std'] = price_df['price'].rolling(window).std()
    
    price_df['z_score'] = (
        (price_df['price'] - price_df['rolling_mean']) / price_df['rolling_std']
    )
    
    price_df['is_anomaly'] = price_df['z_score'].abs() > threshold
    
    return price_df[price_df['is_anomaly']][['timestamp', 'price', 'z_score']]

题型三:算法编程

题目:最优交易执行

给定一个价格序列和需要买入的总量,将买入操作分散到多个时间点以最小化市场冲击成本。

def optimal_execution(prices, total_quantity, max_per_step, impact_factor):
    """
    prices: 预测价格序列
    total_quantity: 需要买入的总量
    max_per_step: 每步最大买入量
    impact_factor: 市场冲击系数 (买入q单位,价格上涨 impact_factor * q)
    
    最小化总成本 = sum(price[i] * q[i] + impact_factor * q[i]^2)
    约束: sum(q[i]) = total_quantity, 0 <= q[i] <= max_per_step
    """
    n = len(prices)
    remaining = total_quantity
    quantities = [0] * n
    
    # 贪心:优先在价格低的时间点买入
    price_indices = sorted(range(n), key=lambda i: prices[i])
    
    for idx in price_indices:
        if remaining <= 0:
            break
        buy_qty = min(remaining, max_per_step)
        quantities[idx] = buy_qty
        remaining -= buy_qty
    
    # 计算总成本
    total_cost = sum(
        prices[i] * quantities[i] + impact_factor * quantities[i] ** 2
        for i in range(n)
    )
    
    return quantities, total_cost

备考策略

核心能力要求

  1. 概率论:条件概率、期望值、马尔可夫链
  2. 统计学:假设检验、回归分析、时间序列
  3. Python/Pandas:数据清洗、聚合、窗口函数
  4. 算法:DP、贪心、数学优化

推荐资源


FAQ

Millennium OA 和其他量化公司(Citadel、Two Sigma)有什么区别?

Millennium OA 更注重数学推理和数据处理能力,编程题难度相对 Citadel 略低,但数学部分更深入。Pandas 数据处理是 Millennium 的特色考点。

Millennium Quant Intern 需要什么背景?

通常要求数学、统计、物理、CS 或金融工程背景。强调定量分析能力,有 Python 数据分析经验是加分项。

Millennium 的面试流程是什么?

OA → 技术电话面(数学 + 编程)→ Onsite(2-3 轮,含 Case Study)→ Team Matching。整个流程约 4-6 周。

Millennium OA 可以用什么语言?

主要支持 Python(推荐,因为有 Pandas 题)和 C++。部分纯算法题也支持 Java。

Millennium 的薪资水平如何?

Quant Intern 薪资在对冲基金中属于顶级水平,年化总包通常 $200K+(含 base + bonus)。


正在准备 Millennium OA?

oavoservice 提供专业的量化对冲基金 OA/VO 辅助服务,覆盖 Millennium、Citadel、Two Sigma、DE Shaw 等顶级机构。

👉 立即添加微信:Coding0201获取真题与辅助方案


联系方式

Email: [email protected]
Telegram: @OAVOProxy