CODING CHALLENGES

代码题库

用接近 LeetCode 的题表进入训练:先筛选题目,再进入双栏题面和编辑器。每道题只展示它实际声明支持的语言。

继续刷题

题目列表

显示 104 / 646 道可提交题。 当前筛选:标签:Array,权限:订阅,语言:Python

提交状态:未尝试未正确已正确
未尝试
coding-alpha-blending-shrinkage订阅锁定
两路 alpha 的收缩融合并 z-score 标准化

Shrinkage Blend of Two Alpha Sources with Z-Score Normalization

中等面试准备Python / C++ / Rust
未尝试
coding-american-mc-longstaff-schwartz订阅锁定
American Put Pricing via Longstaff-Schwartz Least-Squares Monte Carlo

American Put Pricing via Longstaff-Schwartz Least-Squares Monte Carlo

困难面试准备Python / C++ / Rust
未尝试
coding-arrival-price-vs-twap-decision订阅锁定
Arrival Price 与 TWAP 切片在 alpha 衰减下的决策

Arrival Price vs TWAP Decision under Alpha Decay

中等面试准备Python / C++ / Rust
未尝试
coding-arrival-vs-vwap-shortfall订阅锁定
Dual-Benchmark IS — Arrival Price vs Interval VWAP

Dual-Benchmark IS — Arrival Price vs Interval VWAP

中等面试准备Python / C++ / Rust
未尝试
coding-asof-merge-prices-trades订阅锁定
时序对齐合并:为每笔成交附上最近的中间价

As-of Merge — Attach Most-Recent Mid-Price to Each Trade

中等面试准备Python / C++ / Rust
未尝试
coding-asof-merge-trade-fills订阅锁定
时序对齐合并:成交与报价的 as-of 拼接

As-of Merge — Trades against Quotes

中等面试准备Python / C++ / Rust
未尝试
coding-asset-beta-to-benchmark-portfolio订阅锁定
资产对基准组合的逐资产 Beta

Per-Asset Beta to a Benchmark Portfolio

中等面试准备Python / C++ / Rust
未尝试
coding-backtest-with-borrow-cost订阅锁定
含隔夜融券成本的日频回测

Daily Backtest with Overnight Borrow Cost

中等面试准备Python / C++ / Rust
未尝试
coding-basel-traffic-light-zones订阅锁定
Basel VaR Backtest Traffic-Light Zones

Basel VaR Backtest Traffic-Light Zones

简单面试准备Python / C++ / Rust
未尝试
coding-blocked-cv-time-respecting订阅锁定
时序保留的分块 CV:连续折,train 严格早于 test

Blocked Time-Respecting CV: Contiguous Folds with Train-Before-Test

中等面试准备Python / C++ / Rust
未尝试
coding-bond-portfolio-key-rate-duration-hedge订阅锁定
Bond Portfolio Key-Rate Duration Hedge via Least Squares

Bond Portfolio Key-Rate Duration Hedge via Least Squares

困难面试准备Python / C++ / Rust
未尝试
coding-brinson-attribution-three-effects订阅锁定
Brinson-Hood-Beebower 三效应归因

Brinson-Hood-Beebower Three-Effect Attribution

中等面试准备Python / C++ / Rust
未尝试
coding-butterfly-arbitrage-check订阅锁定
识别看涨期权行权价网格上的蝶式无套利违规

Detect Butterfly-Arbitrage Violations on a Call-Price Strike Grid

中等面试准备Python / C++ / Rust
未尝试
coding-calmar-ratio-annualized-return-over-mdd订阅锁定
Calmar 比率——年化收益与最大回撤

Calmar Ratio — Annualized Return over Maximum Drawdown

中等面试准备Python / C++ / Rust
未尝试
coding-choueifaty-diversification-ratio订阅锁定
高斯组合的 Choueifaty 分散化比率

Choueifaty Diversification Ratio of a Gaussian Portfolio

中等面试准备Python / C++ / Rust
未尝试
coding-christoffersen-independence-test订阅锁定
Christoffersen 独立性检验(VaR 突破聚集)

Christoffersen Independence Test for VaR Breach Clustering

中等面试准备Python / C++ / Rust
未尝试
coding-compact-tick-buffer订阅锁定
把环形 tick 缓冲压缩成等长时间切片

Compact a Ring-Buffer of Ticks into Evenly-Bucketed Time Slices

中等面试准备Python / C++ / Rust
未尝试
coding-component-var-gaussian-portfolio订阅锁定
高斯组合的分量 VaR 分解

Component VaR Decomposition for a Gaussian Portfolio

中等面试准备Python / C++ / Rust
未尝试
coding-composite-factor-icir-weighted订阅锁定
基于 IC-IR 的三因子复合加权

IC-IR-Weighted Composite of Three Sub-Factors

中等面试准备Python / C++ / Rust
未尝试
coding-correlated-portfolio-var-from-standalone-vars订阅锁定
由分桌台 VaR 与损失相关矩阵聚合多桌台组合 VaR

Aggregate Multi-Desk VaR from Standalone VaRs and a Loss-Correlation Matrix

中等面试准备Python / C++ / Rust
未尝试
coding-correlated-shock-mc订阅锁定
相关因子冲击蒙特卡洛(压力 P&L)

Correlated Factor-Shock Monte-Carlo for Stress P&L

中等面试准备Python / C++ / Rust
未尝试
coding-cross-sectional-demean订阅锁定
横截面 alpha 因子的去均值

Cross-Sectional Demean of an Alpha Factor

中等面试准备Python / C++ / Rust
未尝试
coding-decile-spread-return订阅锁定
横截面十分位多空价差收益:跨期平均

Decile-Spread Forward Return Averaged Across Dates

中等面试准备Python / C++ / Rust
未尝试
coding-dedup-tick-stream订阅锁定
按 (ts, exchange-seq) 去重 tick 流:以最晚到达的 ingest_ts 为准

Deduplicate a Replayed Tick Stream by (ts, exchange-seq), Latest-Ingest Wins

中等面试准备Python / C++ / Rust
未尝试
coding-double-no-touch-mc订阅锁定
双不触碰期权的对偶变量蒙特卡洛定价

Double-No-Touch Pricing via Antithetic-Variate Monte Carlo

中等面试准备Python / C++ / Rust
未尝试
coding-downsample-to-bars订阅锁定
把逐笔流降采样为 OHLCV K 线(右闭约定)

Downsample a Tick Stream into OHLCV Bars (Right-Closed)

中等面试准备Python / C++ / Rust
未尝试
coding-ewma-sharpe-ratio订阅锁定
指数加权 Sharpe 比率

Exponentially-Weighted Sharpe Ratio

中等面试准备Python / C++ / Rust
未尝试
coding-excess-returns-from-benchmark订阅锁定
相对基准的超额收益

Excess Returns Over a Benchmark

中等面试准备Python / C++ / Rust
未尝试
coding-execution-quality-score-blend订阅锁定
Composite Broker Execution-Quality Score with Direction-Aware Z-Score Blend

Composite Broker Execution-Quality Score with Direction-Aware Z-Score Blend

中等面试准备Python / C++ / Rust
未尝试
coding-factor-shock-scenario-pnl订阅锁定
Factor-Shock Scenario P&L on a Linear Factor Model

Factor-Shock Scenario P&L on a Linear Factor Model

中等面试准备Python / C++ / Rust
未尝试
coding-fillrate-by-venue-with-cis订阅锁定
按场所统计的成交率与 Wilson 置信区间

Per-Venue Fill Rate with Wilson Confidence Intervals

中等面试准备Python / C++ / Rust
未尝试
coding-forward-fill-missing-minutes订阅锁定
把交易日内缺失的分钟用前一笔向前填充

Forward-Fill Missing Minutes Within a Trading Session

中等面试准备Python / C++ / Rust
未尝试
coding-groupby-mean-by-key订阅锁定
按 key 分组求均值,并附最小样本数门控

Groupby-Mean by Key with a Min-Count Gate

中等面试准备Python / C++ / Rust
未尝试
coding-historical-stress-loss-replay订阅锁定
历史压力情景损失复盘

Historical Stress Loss Replay

中等面试准备Python / C++ / Rust
未尝试
coding-idiosyncratic-volatility订阅锁定
特异波动率因子:滚动剥离市场 β 后的残差标准差

Idiosyncratic Volatility Factor — Rolling Residual Std After Market Beta

中等面试准备Python / C++ / Rust
未尝试
coding-implementation-shortfall-attribution订阅锁定
Implementation Shortfall — Three-Component Attribution

Implementation Shortfall — Three-Component Attribution

中等面试准备Python / C++ / Rust
未尝试
coding-implied-vol-vega-weighted-blend订阅锁定
跨行权价格点的 vega 加权平均隐含波动率

Vega-Weighted Average Implied Volatility Across a Strike Grid

中等面试准备Python / C++ / Rust
未尝试
coding-importance-sampling-deep-otm-mc订阅锁定
Importance Sampling for Deep OTM Monte Carlo

Importance Sampling for Deep OTM Monte Carlo

困难面试准备Python / C++ / Rust
未尝试
coding-incremental-var-of-candidate-trade订阅锁定
候选交易的增量 VaR

Incremental VaR of a Candidate Trade

中等面试准备Python / C++ / Rust
未尝试
coding-information-ratio-active-return订阅锁定
主动收益序列的 Information Ratio

Information Ratio of an Active-Return Series

中等面试准备Python / C++ / Rust
未尝试
coding-jump-diffusion-merton-mc订阅锁定
Merton Jump-Diffusion European Call via Monte Carlo

Merton Jump-Diffusion European Call via Monte Carlo

困难面试准备Python / C++ / Rust
未尝试
coding-lag-lead-transform-by-key订阅锁定
按 key 做滞后/前瞻偏移——组内时序位移

Lag/Lead Shift by Key — Within-Group Time-Series Offset

中等面试准备Python / C++ / Rust
未尝试
coding-limit-order-fill-simulation订阅锁定
基于高低价 bar 的限价单成交模拟

Limit-Order Fill Simulation against High-Low Bars

中等面试准备Python / C++ / Rust
未尝试
coding-look-ahead-bias-detector订阅锁定
通过滞后相关比较检测前视偏差

Look-Ahead Bias Detector via Lagged-Correlation Comparison

中等面试准备Python / C++ / Rust
未尝试
coding-lookback-call-mc订阅锁定
固定执行价回望看涨期权的蒙特卡洛定价

Fixed-Strike Lookback Call Pricing via Monte Carlo

中等面试准备Python / C++ / Rust
未尝试
coding-marginal-var-gaussian-portfolio订阅锁定
高斯组合的边际 VaR 敏感度

Marginal VaR Sensitivity for a Gaussian Portfolio

中等面试准备Python / C++ / Rust
未尝试
coding-max-drawdown-decomposition订阅锁定
最大回撤分解

Max Drawdown Decomposition

中等面试准备Python / C++ / Rust
未尝试
coding-max-drawdown-duration订阅锁定
累积净值曲线上的最长回撤期

Maximum Drawdown Duration on the Equity Curve

中等面试准备Python / C++ / Rust
未尝试
coding-mean-reversion-residual订阅锁定
均值回复因子:对基准残差化的过去 K 日收益

Mean-Reversion Factor — Residualized Last-K Return

中等面试准备Python / C++ / Rust
未尝试
coding-modigliani-m-squared-ratio订阅锁定
Modigliani M² — 波动率等价化的风险调整后收益

Modigliani M-Squared — Vol-Rescaled Risk-Adjusted Return

中等面试准备Python / C++ / Rust
未尝试
coding-multi-leg-shortfall-attribution订阅锁定
Multi-Leg Implementation Shortfall — Basket Covariance Attribution

Multi-Leg Implementation Shortfall — Basket Covariance Attribution

困难面试准备Python / C++ / Rust
未尝试
coding-multi-level-monte-carlo-european-call订阅锁定
Multi-Level Monte Carlo for a European Call

Multi-Level Monte Carlo for a European Call

困难面试准备Python / C++ / Rust
未尝试
coding-mutual-information-feature-rank订阅锁定
用直方图估计的互信息对特征做相关性排序

Rank Features by Histogram-Estimated Mutual Information with the Target

困难面试准备Python / C++ / Rust
未尝试
coding-neutralize-by-group订阅锁定
按行业标签做分组中性化

Group-Neutralize a Factor by Sector Tag

中等面试准备Python / C++ / Rust
未尝试
coding-omega-ratio-at-threshold订阅锁定
收益序列在阈值处的 Omega 比率

Omega Ratio of a Return Series at a Threshold

中等面试准备Python / C++ / Rust
未尝试
coding-online-pca-oja-rule-streaming订阅锁定
Online PCA via Oja's Rule (Streaming PC1)

Online PCA via Oja's Rule (Streaming PC1)

困难面试准备Python / C++ / Rust
未尝试
coding-online-zscore-anomaly-flag订阅锁定
在线 Z 分数异常打标

Online Z-Score Anomaly Flag

中等面试准备Python / C++ / Rust
未尝试
coding-pead-earnings-drift订阅锁定
财报公告后漂移信号:D+1 至 D+60 累计超额收益

Post-Earnings Announcement Drift Signal (D+1 to D+60 Excess Return)

中等面试准备Python / C++ / Rust
未尝试
coding-percent-change-from-base订阅锁定
相对可配置基的百分变化

Percent-Change from a Configurable Base

中等面试准备Python / C++ / Rust
未尝试
coding-pivot-long-to-wide-panel订阅锁定
长表转宽表:把 (date, ticker, value) 面板透视成二维矩阵

Long-to-Wide Pivot — Reshape a (Date, Ticker, Value) Panel into a Matrix

中等面试准备Python / C++ / Rust
未尝试
coding-portfolio-delta-aggregation订阅锁定
按标的汇总账本 delta

Aggregate Book Delta per Underlying

中等面试准备Python / C++ / Rust
未尝试
coding-position-cap-clamp订阅锁定
单资产与组合层级敞口上限的目标权重夹取

Per-Asset and Portfolio Cap Clamping for Target Weights

中等面试准备Python / C++ / Rust
未尝试
coding-position-pnl-with-fees订阅锁定
含手续费的持仓盈亏

Position P&L With Transaction Fees

中等面试准备Python / C++ / Rust
未尝试
coding-pov-rate-schedule订阅锁定
带上下限的反应式 POV 执行调度

Reactive POV Schedule with Min/Max Catch-Up Bounds

中等面试准备Python / C++ / Rust
未尝试
coding-purged-cv-folds订阅锁定
带禁运区的 Purged K 折交叉验证

Purged k-Fold CV with Embargo

中等面试准备Python / C++ / Rust
未尝试
coding-purged-kfold-cv-time-series订阅锁定
时间序列机器学习的 Purged K 折交叉验证

Purged k-Fold Cross-Validation for Time-Series ML

困难面试准备Python / C++ / Rust
未尝试
coding-rank-bucket-decile订阅锁定
横截面排名分桶:按序数排名(首现破平)映射到十分位

Cross-Sectional Rank Bucketing into Deciles with Ordinal Tie-Breaks

中等面试准备Python / C++ / Rust
未尝试
coding-rank-corr-spearman订阅锁定
两因子序列的 Spearman 等级相关:平均排名破平

Spearman Rank Correlation with Average-Rank Tie Breaking

中等面试准备Python / C++ / Rust
未尝试
coding-rank-gauss-transform订阅锁定
横截面 alpha 因子的 RankGauss 变换

RankGauss Transform on a Cross-Section of Alpha Factors

中等面试准备Python / C++ / Rust
未尝试
coding-rebalance-on-signal-change订阅锁定
按整数桶变化触发再平衡的低换手回测

Turnover-Aware Rebalance on Bucketed-Signal Change

中等面试准备Python / C++ / Rust
未尝试
coding-resample-ohlc-bars订阅锁定
将逐笔成交重采样为定频 OHLC K 线

Resample Tick Prints into Fixed-Interval OHLC Bars

简单面试准备Python / C++ / Rust
未尝试
coding-reverse-stress-test-target订阅锁定
反向压力测试——求达到目标损失的冲击幅度

Reverse Stress Test — Solve for Shock Magnitude Hitting a Target Loss

中等面试准备Python / C++ / Rust
未尝试
coding-rolling-cointegration-johansen-test订阅锁定
Rolling Engle-Granger Cointegration Test for Pairs Trading

Rolling Engle-Granger Cointegration Test for Pairs Trading

困难面试准备Python / C++ / Rust
未尝试
coding-semi-deviation-downside-volatility订阅锁定
围绕样本均值的收益序列半离差

Semi-Deviation of a Return Series Around the Sample Mean

中等面试准备Python / C++ / Rust
未尝试
coding-shortfall-decomp-fee-vs-impact订阅锁定
Implementation Shortfall — Fee vs Market-Impact Decomposition

Implementation Shortfall — Fee vs Market-Impact Decomposition

中等面试准备Python / C++ / Rust
未尝试
coding-size-factor-log-mcap订阅锁定
规模因子:负对数市值的横截面 z-score

Size Factor as Negative Log Market Cap (Cross-Sectional Z-Score)

中等面试准备Python / C++ / Rust
未尝试
coding-sortino-ratio-with-target订阅锁定
带目标收益的收益序列 Sortino 比率

Sortino Ratio of a Return Series with Target Return

中等面试准备Python / C++ / Rust
未尝试
coding-stratified-sampling-mc-european订阅锁定
分层抽样蒙特卡洛:欧式看涨期权定价

European Call MC with Stratified Sampling on Terminal Z

困难面试准备Python / C++ / Rust
未尝试
coding-stress-coverage-ratio-against-capital订阅锁定
Stress Coverage Ratios Against Available Capital

Stress Coverage Ratios Against Available Capital

简单面试准备Python / C++ / Rust
未尝试
coding-stress-loss-aggregation-by-bucket订阅锁定
按桶维度聚合压力测试损失

Stress-Loss Aggregation by Bucket

简单面试准备Python / C++ / Rust
未尝试
coding-survivorship-aware-universe订阅锁定
考虑幸存者偏差的当日可交易股票池

Survivorship-Aware Tradeable Universe on a Date

中等面试准备Python / C++ / Rust
未尝试
coding-systematic-vs-idiosyncratic-variance-decomposition订阅锁定
系统性与特异性方差分解(因子模型)

Systematic-vs-Idiosyncratic Variance Decomposition (Factor Model)

中等面试准备Python / C++ / Rust
未尝试
coding-tick-buffer-binary-search-by-ts订阅锁定
Tick 缓冲:按时间戳的二分查找与区间扫描

Tick Buffer — Binary-Search Lookup and Range Scan by Timestamp

中等面试准备Python / C++ / Rust
未尝试
coding-tracking-error-contribution-by-sector订阅锁定
各行业对跟踪误差方差的贡献

Tracking-Error Variance Contribution by Sector

中等面试准备Python / C++ / Rust
未尝试
coding-tracking-error-sample-stdev订阅锁定
主动收益序列的标量 Tracking Error

Scalar Tracking Error of an Active-Return Series

中等面试准备Python / C++ / Rust
未尝试
coding-trailing-momentum-factor订阅锁定
滚动 12-1 动量因子(跳过最近一段)

Trailing 12-1 Momentum Factor (Skip Last Month)

中等面试准备Python / C++ / Rust
未尝试
coding-transaction-cost-aware-target订阅锁定
考虑交易成本的目标权重求解

Transaction-Cost-Aware Target Weights from Alpha Signal

中等面试准备Python / C++ / Rust
未尝试
coding-treynor-ratio-systematic-risk-adjusted订阅锁定
Treynor 比率 — 系统性风险调整后的超额收益

Treynor Ratio — Systematic-Risk-Adjusted Excess Return

中等面试准备Python / C++ / Rust
未尝试
coding-twap-equal-slice-schedule订阅锁定
TWAP 等量切片调度与前置余量分配

TWAP Equal-Slice Schedule with Front-Loaded Residue

中等面试准备Python / C++ / Rust
未尝试
coding-twap-with-no-go-windows订阅锁定
带禁止窗口的 TWAP 调度

TWAP Scheduling Through Forbidden No-Go Windows

困难面试准备Python / C++ / Rust
未尝试
coding-up-down-capture-ratios订阅锁定
相对基准的上行捕获率与下行捕获率

Up-Capture and Down-Capture Ratios versus a Benchmark

中等面试准备Python / C++ / Rust
未尝试
coding-var-breach-counter订阅锁定
统计并标注 VaR 突破日

Count and Timestamp VaR Breaches

中等面试准备Python / C++ / Rust
未尝试
coding-vectorized-pnl-with-borrow-fee-rate-curve订阅锁定
含时变融券费率曲线的向量化 PnL

Vectorized PnL with Time-Varying Borrow Fee Curve

中等面试准备Python / C++ / Rust
未尝试
coding-vectorized-pnl-with-costs订阅锁定
含交易成本的向量化逐期 PnL

Vectorized Per-Period PnL with Transaction Costs

中等面试准备Python / C++ / Rust
未尝试
coding-vega-pnl-explain订阅锁定
按执行价网格的 Vega 分桶盈亏归因

Vega-Bucketed PnL Explain Across a Strike Grid

中等面试准备Python / C++ / Rust
未尝试
coding-vol-surface-totalvar-interp订阅锁定
Linear Total-Variance Interpolation Across Maturities

Linear Total-Variance Interpolation Across Maturities

中等面试准备Python / C++ / Rust
未尝试
coding-vwap-deviation-by-broker订阅锁定
VWAP Deviation by Broker

VWAP Deviation by Broker

中等面试准备Python / C++ / Rust
未尝试
coding-vwap-tracking-error-pnl订阅锁定
VWAP Tracking-Error P&L

VWAP Tracking-Error P&L

中等面试准备Python / C++ / Rust
未尝试
coding-vwap-volume-curve-schedule订阅锁定
沿成交量曲线的 VWAP 调度与参与率上限

VWAP Schedule Along a Volume Curve with Participation Cap

中等面试准备Python / C++ / Rust
未尝试
coding-walkforward-expanding-window-folds订阅锁定
走向前 CV:扩展窗口与滚动窗口折

Walk-forward CV: Expanding and Rolling-window Folds

中等面试准备Python / C++ / Rust
未尝试
coding-walkforward-validation-strategy订阅锁定
Walk-Forward Validation for Time-Series Backtests

Walk-Forward Validation for Time-Series Backtests

困难面试准备Python / C++ / Rust
未尝试
coding-welford-online-variance订阅锁定
Welford 在线方差

Welford's Online Variance

简单面试准备Python / C++ / Rust
未尝试
coding-winsorize-cross-sectional订阅锁定
横截面 alpha 因子值的 winsorize 截尾

Cross-Sectional Winsorization of Alpha-Factor Values

中等面试准备Python / C++ / Rust
未尝试
coding-zscore-cross-sectional订阅锁定
横截面 z-score 与可选 winsorize 截尾

Cross-Sectional Z-Score with Optional Winsorization

中等面试准备Python / C++ / Rust