CODING CHALLENGES

代码题库

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

继续刷题

题目列表

显示 102 / 646 道可提交题。 当前筛选:标签:Microstructure,权限:免费,语言:Python

提交状态:未尝试未正确已正确
未尝试
coding-active-quote-peak-count可练习
报价引擎活跃集合:并发活跃报价的峰值数量

Quote Engine Active Set: Peak Concurrently-Live Quotes

中等免费版Python / C++ / Rust
未尝试
coding-best-pnl-state-with-cooldown可练习
二值仓位策略 —— 含离场后强制冷静期的最佳 PnL

Binary-State Strategy — Best PnL With Post-Exit Cooldown

中等免费版Python / C++ / Rust
未尝试
coding-bucket-histogram-trade-sizes可练习
用右闭分桶把交易笔数归入规模档位

Trade-Size Tier Histogram via Right-Inclusive Edges

简单免费版Python / C++ / Rust
未尝试
coding-bucket-sort-pnl-quantiles可练习
桶排序构建盈亏直方图

Bucket-Sort P&L Histogram

简单免费版Python / C++ / Rust
未尝试
coding-build-largest-pnl-concat可练习
拼接最大 P&L 信号强度串

Build Largest P&L Signal-Strength String

中等免费版Python / C++ / Rust
未尝试
coding-canonical-symbol-form可练习
代码符号规整 — 跨场所去重分组

Canonical Ticker-Symbol Form — Cross-Venue Dedup

简单免费版Python / C++ / Rust
未尝试
coding-canonical-symbol-group-ids可练习
预聚合分桶标签:多场所同标的的规范化分组编号

Pre-Aggregation Bucket Labels: Canonical-Form Group IDs for Multi-Venue Symbols

中等免费版Python / C++ / Rust
未尝试
coding-closer-stronger-bid-distance-bidirectional可练习
双向更强买价的最近距离:取前向 / 后向严格更高 print 中较近者

Closer-Stronger Bid Distance (Bidirectional): Min of Prev / Next Strictly-Higher Bid

中等免费版Python / C++ / Rust
未尝试
coding-consolidated-best-bid-k-feeds可练习
跨 K 路场所报价流的最优买价合并流

Consolidated Best-Bid Stream Across K Venue Quote Feeds

中等免费版Python / C++ / Rust
未尝试
coding-count-in-band-k-windows可练习
全部报价位于容差带内的 K 期窗口计数

Count K-Tick Windows With Every Quote Inside the Tolerance Band

简单免费版Python / C++ / Rust
未尝试
coding-count-positive-flow-k-windows可练习
严格净流入的 K 期窗口计数

Count of Strictly-Positive Net-Inflow K-Period Windows

简单免费版Python / C++ / Rust
未尝试
coding-counterparty-max-count-differential可练习
对手方活跃度漂移:跨两段成交流水的最大计数差异

Counterparty Activity Shift: Largest Trade-Count Differential Across Two Sessions

简单免费版Python / C++ / Rust
未尝试
coding-counterparty-notional-aggregator可练习
对手方毛敞口聚合器:按规模排序的汇总表

Counterparty Gross-Notional Aggregator: Magnitude-Sorted Roll-Up

简单免费版Python / C++ / Rust
未尝试
coding-cross-buy-sell-tape-events可练习
买价跨越邻近卖价的跨磁带路由质量告警计数

Cross-Tape Buy-Above-Sell Routing-Quality Alert Count

中等免费版Python / C++ / Rust
未尝试
coding-cross-feed-cum-count-lead-exchanges可练习
跨源行情累计计数领先权交换次数

Cross-Feed Cumulative-Count Lead Exchanges

中等免费版Python / C++ / Rust
未尝试
coding-cross-feed-max-min-paired-lag可练习
跨源行情最差最近匹配配对滞后

Worst Cross-Feed Closest-Match Paired Lag

中等免费版Python / C++ / Rust
未尝试
coding-cross-feed-tick-match-count可练习
跨源行情心跳容差匹配计数

Cross-Feed Tick Match Count Within Tolerance Window

中等免费版Python / C++ / Rust
未尝试
coding-cross-feed-unmatched-ticks-each-side可练习
跨源行情两侧各自未匹配心跳计数

Cross-Feed Unmatched Tick Counts Per Side Within Tolerance

中等免费版Python / C++ / Rust
未尝试
coding-daily-pnl-streak-stack可练习
距下一个更高 P&L 的天数

Days Until a Better PnL

简单免费版Python / C++ / Rust
未尝试
coding-day-over-day-counterparty-symmetric-diff可练习
对手方轮动指示器:日间对称差大小序列

Counterparty Rotation Indicator: Day-Over-Day Symmetric-Difference Series

简单免费版Python / C++ / Rust
未尝试
coding-dense-rank-trade-sizes可练习
给当日成交按所属买卖方向做 dense rank 标注

Per-Side Dense-Rank Annotation for the Day's Blotter

简单免费版Python / C++ / Rust
未尝试
coding-distinct-symbols-with-open-orders可练习
持仓监控面板:当前在场的不同标的数量

Open-Order Dashboard Tile: Distinct Symbols Currently In Play

中等免费版Python / C++ / Rust
未尝试
coding-fill-attribution-by-parent-id可练习
按父单 ID 归集成交:子单回填到父单

Fill Attribution by Parent Order ID

简单免费版Python / C++ / Rust
未尝试
coding-find-third-largest-distinct可练习
查找第三大的不同元素

Find Third Largest Distinct

简单免费版Python / C++ / Rust
未尝试
coding-first-order-id-with-freq-k可练习
成交审计频次探针:定位首个生命周期 FIX 事件数恰为 k 的 order ID

Fills-Audit Frequency Probe: First Order-ID Whose Lifecycle Hits Exactly k FIX Events

简单免费版Python / C++ / Rust
未尝试
coding-first-unique-character可练习
第一个唯一字符

First Unique Character

简单免费版Python / C++ / Rust
未尝试
coding-fix-message-checksum-verify可练习
FIX 风格尾字段校验和:管道分隔消息逐条三态判定

FIX-Style Trailing Checksum Verify: Trinary Label Per Pipe-Delimited Message

中等免费版Python / C++ / Rust
未尝试
coding-fix-tag-extract可练习
FIX 风格 tag 取值:在管道分隔消息中取数字 tag 的首个值

FIX-Style Tag Extract: First Value for a Numeric Tag in a Pipe-Delimited Message

中等免费版Python / C++ / Rust
未尝试
coding-gcd-tick-sizes可练习
通用最小价位单元:跨场所 tick size 的最大公约数

Universal Tick Unit: GCD of Per-Venue Tick Sizes

中等免费版Python / C++ / Rust
未尝试
coding-greedy-min-cost-fill可练习
走簿打穿:贪心最小成本撮合

Walking the Book: Greedy Minimum-Cost Fill

中等免费版Python / C++ / Rust
未尝试
coding-incremental-largest-component-size可练习
增量最大聚簇规模:因子对边事件流上的流式并查集

Incremental Largest Cluster Size: Streaming Union-Find on a Factor-Pair Edge Tape

中等免费版Python / C++ / Rust
未尝试
coding-insert-and-merge-orderbook-levels可练习
插入并合并订单簿价格档位区间

Insert and Merge Order-Book Price-Level Intervals

中等免费版Python / C++ / Rust
未尝试
coding-inverse-percentile-rank-by-pnl可练习
日 PnL 在历史分布中的反向百分位排名

Inverse Percentile Rank of Daily PnL Against Reference Distribution

中等免费版Python / C++ / Rust
未尝试
coding-largest-divisible-pair-sort可练习
最大可整除对(排序 + 扫描)

Largest Divisible Pair (Sort + Scan)

简单免费版Python / C++ / Rust
未尝试
coding-largest-volume-rectangle-histogram可练习
直方图中的最大体积矩形

Largest Volume Rectangle in a Histogram

中等免费版Python / C++ / Rust
未尝试
coding-longest-consecutive-sequence-hash可练习
最长连续整数序列(哈希集合)

Longest Consecutive Sequence (Hash Set)

中等免费版Python / C++ / Rust
未尝试
coding-longest-palindromic-substring可练习
最长回文子串

Longest Palindromic Substring

简单免费版Python / C++ / Rust
未尝试
coding-longest-substring-no-repeat可练习
无重复字符的最长子串

Longest Substring Without Repeating Characters

简单免费版Python / C++ / Rust
未尝试
coding-max-nonoverlap-windows-with-switch-gap可练习
单会话子单调度:FIX 重配间隔下的最大不重叠窗口

Single-Session Child-Order Scheduling with FIX Reconfigure Gap

中等免费版Python / C++ / Rust
未尝试
coding-max-reward-trades-min-gap可练习
在合规冷却期约束下的最大累计收益(带时间戳的候选交易)

Maximum Total Reward From Timestamped Trade Candidates Under A Compliance Hold-Period Gap

中等免费版Python / C++ / Rust
未尝试
coding-max-throughput-child-orders-with-windows可练习
单会话最大子单吞吐:每单独立时长与 FIX 重配间隔

Maximum Child-Order Throughput With Per-Order Durations And A FIX-Session Gap

中等免费版Python / C++ / Rust
未尝试
coding-merge-k-quote-streams-heap可练习
带溯源的 K 路报价流合并

Merge K Quote Streams with Lineage

中等免费版Python / C++ / Rust
未尝试
coding-merge-k-venue-trade-tapes可练习
将 K 路场所成交磁带合并为单一时间序流

Merge K Per-Venue Trade Tapes Into One Chronological Stream

中等免费版Python / C++ / Rust
未尝试
coding-merge-news-feed-streams可练习
多源新闻 Feed 取最新 N 条

Top-N Recent Items From Per-Source News Feeds

中等免费版Python / C++ / Rust
未尝试
coding-merge-overlapping-quote-windows可练习
Merge Overlapping Quote-Validity Windows

Merge Overlapping Quote-Validity Windows

简单免费版Python / C++ / Rust
未尝试
coding-merge-two-sorted-lists-iterative可练习
合并两个有序列表 — 迭代双指针

Merge Two Sorted Lists — Iterative Two-Pointer

简单免费版Python / C++ / Rust
未尝试
coding-min-cancels-throttle-window可练习
节流窗口合规回放:最少需撤单次数

Throttle-Window Compliance Replay: Minimum Order Cancels

中等免费版Python / C++ / Rust
未尝试
coding-min-flatten-resets-keep-position-in-band可练习
仓位区间治理:保持净仓在 [-L, +L] 内所需的最少日终归零次数

Position-Band Governance: Minimum Flatten-Resets to Stay Inside [-L, +L]

中等免费版Python / C++ / Rust
未尝试
coding-min-replenish-keep-inventory-positive可练习
对冲存量补货:保持非负所需的最少补货次数

Hedge-Inventory Replenishment: Minimum Top-Ups to Stay Non-Negative

中等免费版Python / C++ / Rust
未尝试
coding-min-routers-with-setup-delay可练习
含 FIX 会话重配延迟的最小路由器数

Minimum Routers with FIX-Session Setup Delay

中等免费版Python / C++ / Rust
未尝试
coding-min-stack-with-getmin可练习
支持 O(1) 取最小值的最小栈

Min-Stack with O(1) get_min

简单免费版Python / C++ / Rust
未尝试
coding-min-window-substring可练习
最小覆盖子串

Minimum Window Substring

困难免费版Python / C++ / Rust
未尝试
coding-most-frequent-consecutive-event-pair可练习
订单事件足迹:找出最频繁的连续事件二元组

Order-Event Footprint: Most-Frequent Consecutive Event-Pair

简单免费版Python / C++ / Rust
未尝试
coding-most-frequent-trade-fingerprint可练习
成交带异常检测:找出重复次数最多的成交指纹

Tape-Anomaly Detector: Most-Repeated Trade Fingerprint

中等免费版Python / C++ / Rust
未尝试
coding-net-position-from-trade-events可练习
由原始成交流水计算日终净头寸

End-of-Day Net Positions from a Raw Trade Tape

中等免费版Python / C++ / Rust
未尝试
coding-next-all-time-high-index可练习
距离下一次新高的索引:首个严格高于「累积最高水位」的未来 tick

Time-to-New-All-Time-High: First Future Index Strictly Above the Running Peak

中等免费版Python / C++ / Rust
未尝试
coding-next-bigger-bid-bounded-distance-ratio可练习
前向窗口内的下一次 depth-jump:在最佳买价深度 tape 上做受限距离比例阈值扫描

Next Depth-Jump within a Forward Window: Bounded-Distance Ratio-Threshold Scan over a Best-Bid-Depth Tape

困难免费版Python / C++ / Rust
未尝试
coding-next-greater-quote-time可练习
下一次更高报价的时间戳

Next Greater Quote Timestamp

简单免费版Python / C++ / Rust
未尝试
coding-next-smaller-element-mono-stack可练习
下一个更小元素的下标

Next Smaller Element Index

简单免费版Python / C++ / Rust
未尝试
coding-online-cumulative-bollinger-bands可练习
在线累计 Bollinger 带:Welford 递推的带对序列

Online Cumulative Bollinger Bands: Welford-Recurrence Band-Pair Stream

中等免费版Python / C++ / Rust
未尝试
coding-online-zscore-outlier-flagger可练习
在线 Z 分数离群标记:用 Welford 累计历史检测 tick 流异常

Online Z-Score Outlier Flagger: Welford-Cumulative Anomaly Detection on a Tick Stream

中等免费版Python / C++ / Rust
未尝试
coding-orphan-cancel-count可练习
路由可靠性检查:统计孤儿撤单数量

Router Reliability Check: Count Orphan Cancellations

中等免费版Python / C++ / Rust
未尝试
coding-pancake-sort-flip-sequence可练习
煎饼排序:翻转序列

Pancake Sort: Flip Sequence

中等免费版Python / C++ / Rust
未尝试
coding-peak-inventory-day-after-batch-trades可练习
批量区间增量交易后的峰值库存日

Peak Inventory Day After Batched Range-Update Trades

简单免费版Python / C++ / Rust
未尝试
coding-percentile-pnl-linear-interp可练习
成交 PnL 的线性插值百分位

Linear-Interpolation Percentile of Trade PnL

中等免费版Python / C++ / Rust
未尝试
coding-prev-stronger-bid-distance可练习
上一次更强买价的距离:到最近一次严格更高买价 print 的间隔

Prev-Stronger Bid Distance: Time Since the Last Strictly-Higher Bid Print

中等免费版Python / C++ / Rust
未尝试
coding-quartile-pack-and-iqr-from-returns可练习
期间收益的四分位包与 IQR

Quartile Pack with IQR from Per-Period Returns

中等免费版Python / C++ / Rust
未尝试
coding-rank-by-multi-key-tiebreak可练习
按多键优先级与次序对记录排序

Rank Records by Multi-Key Tie-Break Rule

简单免费版Python / C++ / Rust
未尝试
coding-rank-inversion-count可练习
排名失配对数:期望榜单与实测榜单的两两逆序对计数

Rank-Disagreement Count: Pairwise Inversions Between Expected and Realized Strategy Rankings

中等免费版Python / C++ / Rust
未尝试
coding-realign-k-tapes-to-global-clock可练习
用各自的时钟偏移把 K 路成交磁带对齐到全局时钟

Realign K Trade Tapes to a Global Clock with Per-Tape Offsets

中等免费版Python / C++ / Rust
未尝试
coding-removing-k-digits-monotonic可练习
删除 K 位数字 — 最小结果

Removing K Digits — Smallest Result

中等免费版Python / C++ / Rust
未尝试
coding-rolling-quote-stale-flags可练习
报价更新时间流上的"陈旧期后首次更新"标记

First-Update-After-Stale-Period Flags on a Quote-Update Timestamp Stream

中等免费版Python / C++ / Rust
未尝试
coding-rolling-trade-rate-window可练习
半开回看滑窗下的实时成交率计数

Live Trade-Rate Count over a Half-Open Lookback Sliding Window

中等免费版Python / C++ / Rust
未尝试
coding-rolling-window-range-spread可练习
双单调队列滑窗下的分钟级行情极差监控

Minute-Bar Range Monitor via Dual-Deque Sliding Max-Minus-Min

中等免费版Python / C++ / Rust
未尝试
coding-roman-to-integer-conversion可练习
罗马数字转整数

Roman Numeral to Integer

简单免费版Python / C++ / Rust
未尝试
coding-running-cumulative-sum-stream可练习
流式累计求和

Running Cumulative Sum over a Stream

简单免费版Python / C++ / Rust
未尝试
coding-running-distinct-counterparty-count可练习
对手方多样性诊断:滚动累计不同对手方数量

Counterparty Diversity Diagnostic: Running Distinct Counterparty Count

中等免费版Python / C++ / Rust
未尝试
coding-running-unbroken-bid-stack-sum可练习
仍未被击穿的买价栈累加和:当下尚未被覆盖的支撑层合计

Running Unbroken-Bid Stack Sum: Cumulative Support of Still-Standing Prior Bids

中等免费版Python / C++ / Rust
未尝试
coding-shortest-window-k-spikes可练习
收益流中包含 K 个幅度跳点的最短窗口

Shortest Window Containing K Magnitude Spikes in a Return Stream

中等免费版Python / C++ / Rust
未尝试
coding-size-weighted-median-fillprice可练习
成交量加权中位数成交价

Size-Weighted Median Fill Price

中等免费版Python / C++ / Rust
未尝试
coding-sliding-window-max-quote可练习
报价滑动窗口最大值

Sliding Window Max of Quotes

中等免费版Python / C++ / Rust
未尝试
coding-stock-span-monotonic-stack可练习
在线股价跨度

Online Stock Span

中等免费版Python / C++ / Rust
未尝试
coding-strategy-pnl-bookkeeping可练习
按策略维度的盯市 P&L 簿记

Per-Strategy P&L Bookkeeping with Mark-to-Market

中等免费版Python / C++ / Rust
未尝试
coding-strategy-rank-by-sharpe-then-id可练习
策略排行榜:按 Sharpe 取前 K,同分按 strategy_id 字典序

Strategy Leaderboard: Top-K by Sharpe with Lexicographic Tie-Break

中等免费版Python / C++ / Rust
未尝试
coding-stream-distinct-count-elements可练习
流式不同元素的运行计数

Stream Running Distinct Count

简单免费版Python / C++ / Rust
未尝试
coding-stream-kth-largest-pnl可练习
流式 K 大盈亏

Streaming K-th Largest P&L

简单免费版Python / C++ / Rust
未尝试
coding-stream-running-vwap-merged-tapes可练习
跨 K 路场所成交磁带的 running VWAP 流式计算

Running VWAP Across Merged K-Venue Trade Tapes

中等免费版Python / C++ / Rust
未尝试
coding-streaming-median-time-window可练习
固定时间窗口内的流式中位数

Streaming Median Over a Fixed Time Window

中等免费版Python / C++ / Rust
未尝试
coding-streaming-running-mode可练习
流式运行众数:基于懒删除堆维护最高频值

Streaming Running Mode — Most-Frequent Value with Lazy-Deletion Heap

中等免费版Python / C++ / Rust
未尝试
coding-streaming-top-k-by-notional可练习
流式聚合:成交金额前 K 名股票

Streaming Top-K Tickers by Notional

中等免费版Python / C++ / Rust
未尝试
coding-string-reverse-sentence-words可练习
反转句子中的单词

Reverse Words in a Sentence

简单免费版Python / C++ / Rust
未尝试
coding-string-valid-palindrome-check可练习
有效回文判断(仅字母数字、忽略大小写)

Valid Palindrome (Alphanumeric, Case-Insensitive)

简单免费版Python / C++ / Rust
未尝试
coding-subarray-min-cost-fill可练习
订单簿全档位区间的均匀打穿股数总量

Total Uniform-Fill Shares across Every Order-Book Level Range

中等免费版Python / C++ / Rust
未尝试
coding-sum-of-min-bid-depth-sweeps可练习
所有连续价位带扫荡的瓶颈深度合计:深度均匀度评分

Aggregate Bottleneck Bid-Depth across All Contiguous Price-Band Sweeps (Depth-Uniformity Score)

困难免费版Python / C++ / Rust
未尝试
coding-sum-subarray-mins-pnl可练习
P&L 子数组最小值之和

Sum of Subarray Minimum P&Ls

中等免费版Python / C++ / Rust
未尝试
coding-three-stream-synchronized-triple-count可练习
三流容差同步三元组计数

Three-Stream Synchronized Triple Count Within Tolerance

中等免费版Python / C++ / Rust
未尝试
coding-topk-slippage-stable-tiebreak可练习
TCA 最差 K 笔成交:滑点 Top-K 与到达序号稳定打破并列

TCA Worst-K Fills: Top-K Slippage with Stable Arrival-Seq Tiebreak

中等免费版Python / C++ / Rust
未尝试
coding-trades-to-ohlcv-bars可练习
把成交磁带聚合为分桶 OHLCV K 线

Aggregate a Trade Tape Into Per-Bucket OHLCV Bars

中等免费版Python / C++ / Rust
未尝试
coding-trailing-high-watermark-span可练习
跟踪最高水位 span:每个 tick 的连续不超过当前价的回看长度

Trailing High-Watermark Span: Per-Tick Consolidation Length on a Synthetic Tape

中等免费版Python / C++ / Rust
未尝试
coding-trapping-volume-between-quotes可练习
局部高点报价之间的最大囤积体积

Trapping Volume Between Local-Max Quotes

中等免费版Python / C++ / Rust
未尝试
coding-valid-anagram-character-counts可练习
有效的字母异位词(字符计数)

Valid Anagram (Character Counts)

简单免费版Python / C++ / Rust
未尝试
coding-window-argmin-offset可练习
滑窗最低价的窗内偏移:每段定长窗口内最低价相对左缘的位置

Sliding-Window Argmin Offset: Per-Window Position of the Minimum Price Relative to the Window Left Edge

中等免费版Python / C++ / Rust