
Hello,我是小兔大白糖。 这篇整理面试口述与高频追问要点,方便对照站内同主题通识文。
定位:后端开发面试,只需基础理解,不涉及量化数学、做市算法编写
每个知识点:通俗定义 → 业务价值 → 后端开发关联 → 面试高频问答
1. 流动性(Liquidity)、盘口深度(Order Book Depth)、滑点(Slippage)
通俗定义
流动性 = 市场上能快速、低成本完成大额交易的能力。类比:菜市场卖白菜——摊位越多、白菜越多 = 流动性越好,你买 100 斤也不会把价格推高。
盘口深度 = 订单簿(Order Book)上挂了多少买单和卖单。深度越深,单个大单对价格的冲击越小。
滑点 = 你期望的价格和实际成交价格之间的差距。下一个 100 BTC 的市价单 → 吃了好几层卖单 → 最终均价和第一档价格差多少 = 滑点。
深度好: 卖1: 100@$50000, 卖2: 200@$50001, 卖3: 500@$50002
→ 买100 BTC → 全部 $50000 成交,滑点=0
深度差: 卖1: 5@$50000, 卖2: 10@$50010, 卖3: 20@$50050
→ 买100 BTC → 均价$50040,滑点=0.08%
业务价值
| 角色 | 流动性好= | 流动性差= |
|---|---|---|
| 交易所 | 用户多、手续费收入高 | 用户流失到竞品 |
| 交易员 | 大单不滑点、成本低 | 一买就涨一卖就跌 |
| 做市商 | 赚买卖价差(spread) | 无人交易,挂单成交不了 |
后端开发关联
你在后端要关心的:
1. 订单簿数据结构 —— 如何存储和快速查询盘口深度
2. 撮合引擎性能 —— 如何在高并发下高效匹配买卖单
3. 行情推送延迟 —— 盘口变化如何以最低延迟推送给交易员
4. 流动性监控 —— 如何实时判断某交易对流动性是否健康
面试高频问答
Q: What is liquidity and why does it matter for a trading platform?
"Liquidity is the ability to execute large trades quickly without significantly
moving the price. On a deep order book, you can buy 100 BTC at close to the
best ask price. On a thin book, the same order eats through multiple price levels
and you end up paying much more — that's slippage.
For a trading platform, liquidity IS the product. Without it, traders leave.
My role as a backend engineer is to ensure the systems that support liquidity —
order matching, market data distribution, risk checks — are fast, reliable,
and can handle spikes without degrading."
2. 做市商(Market Maker)、挂单(Maker)、吃单(Taker)
通俗定义
做市商(Market Maker) = 同时在买一和卖一挂单的人/程序。赚的是买卖价差(spread),提供流动性换取手续费优惠。
做市商挂单:
买价 $50,000 ← 希望有人卖给他
卖价 $50,001 ← 希望有人从他这买
差价 $1 = spread = 做市商的利润
Maker(挂单方) = 在订单簿上挂限价单等着成交的人 → 提供流动性 → 手续费低
Taker(吃单方) = 下市价单立刻吃掉订单簿上已有订单的人 → 消耗流动性 → 手续费高
业务价值
- Maker 给平台提供深度 → 平台愿意给抵扣手续费
- Taker 给做市商提供利润 → 做市商愿意继续挂单
- 良性循环:做市商挂单 → 有深度 → 散户来交易 → 做市商赚 spread → 继续挂单
后端开发关联
你要关心的:
1. 手续费系统:如何区分 maker/taker 并计算不同费率
2. 做市商 API:如何给机构做市商提供低延迟下单、撤单接口
3. Maker/Taker 识别:撮合时如何判断一笔成交里谁是 maker 谁是 taker
→ 先挂在订单簿上的那个是 maker,后来吃掉它的那个是 taker
面试高频问答
Q: What's the difference between a maker and a taker order?
"A maker order adds liquidity — it rests on the order book as a limit order
waiting to be filled. A taker order removes liquidity — it immediately matches
against existing orders on the book.
From a fee perspective: makers pay lower fees because they provide value to
the platform, while takers pay higher fees because they consume that liquidity.
From an engineering perspective: recognizing which side is maker vs taker at
match time requires checking order timestamps — the order that arrived first
on the book is the maker."
3. 流动性平台核心运作逻辑
通俗定义
流动性平台 = 连接做市商和交易所的中间层。负责:接收做市商的报价 → 聚合多个做市商的流动性 → 展示给交易端 → 路由订单到最优价格。
核心链路
做市商 A(挂卖单) ─┐
做市商 B(挂卖单) ─┤→ 流动性聚合层 → 订单簿 → 撮合引擎 → 成交/撤单
做市商 C(挂卖单) ─┘ ↑ ↓
策略引擎监控 行情推送给所有用户
后端开发关联
你在后端构建的是:
1. 做市商网关(Market Maker Gateway)— 接收做市商报价,低延迟写入订单簿
2. 报价聚合引擎 — 多个做市商对同一交易对报价,如何合并展示
3. 订单路由 — 用户的交易请求路由到哪个做市商的报价
4. 策略引擎 — 做市商配置的自动化策略如何调度执行
5. 清算结算 — 成交后的资金划转
面试高频问答
Q: Describe how a liquidity platform works at a high level.
"A liquidity platform aggregates quotes from multiple market makers and presents
a unified order book to traders. The core flow is:
1. Market makers submit quotes (bid/ask) via API or WebSocket
2. The platform validates, normalizes, and merges these into a consolidated book
3. When a trader places an order, the matching engine finds the best price
across all liquidity providers
4. Post-trade: settlement, fee calculation, position update
The key architectural challenge is latency — every microsecond between a market
maker updating their quote and that update reaching the order book is risk for
them. So we need ultra-low-latency market data distribution and order routing."
4. 做市策略的基础运作逻辑
通俗定义
做市策略 = 交易员设定一组参数(什么价格挂、挂多少量、价差多大、什么时候撤),策略引擎自动循环执行"挂单→监控→调整→撤单"。
注意:你不需要懂策略怎么写。你只需要懂"交易员配参数 → 系统自动执行"这条链路。
执行链路
交易员配置策略:
"BTC-USDT,双边挂单,价差 0.1%,单边量 5 BTC,
偏离市场价 > 0.5% 时撤单重挂,每 100ms 检查一次"
↓
策略引擎读取配置 → 订阅行情 → 计算挂单价
→ 发送限价单到订单簿 → 监控成交/市场变化
→ 成交了?补单(保持两边都有量)
→ 价格跑了?撤掉旧单 → 新价格重新挂
↓
这条链路全部自动化,交易员只需要调参数
后端开发关联
你负责的是策略引擎的"骨架",不是策略逻辑本身:
1. 策略配置管理:参数的 CRUD、版本控制、灰度发布
2. 策略调度:什么时机触发策略检查?定时器?行情变化事件?
3. 策略执行沙箱:策略跑炸了不能影响其他策略或主服务
4. 风险检查:每笔策略发出的订单都要过风控
5. 监控:策略的盈亏、成交率、延迟——交易员要实时看
面试高频问答
Q: How does a strategy engine execute a market-making strategy?
"I don't write the strategy logic myself — that's the quant team's work.
What I build is the execution framework:
1. Strategy configuration: traders set parameters like spread width, order size,
re-quote threshold, max position via a config service
2. Scheduling loop: the engine reads config, subscribes to market data,
calculates target orders, and sends them to the matching engine
3. Risk gating: every order generated by a strategy must pass through
pre-trade risk checks before reaching the market
4. Monitoring & circuit breakers: if P&L drops below threshold or quote rate
exceeds limits, the engine auto-suspends the strategy
My job is making this pipeline fast, reliable, and safe — not designing the
pricing model inside it."
5. 策略引擎(Strategy Engine)、策略调度(Strategy Scheduler)、策略参数配置
通俗定义
| 概念 | 通俗类比 | 做什么 |
|---|---|---|
| 策略引擎 | 自动驾驶系统 | 执行策略逻辑:读行情→算价格→发订单 |
| 策略调度 | 交通指挥中心 | 决定什么时候触发哪个策略:定时/事件驱动/手动 |
| 参数配置 | 驾驶参数面板 | 存储交易员设定的参数(价差/量/风控阈值等) |
后端开发关联
策略引擎:
→ 高并发:同时运行几百个策略实例
→ 低延迟:从行情变化到策略发出订单,延迟要 <1ms
→ 隔离性:一个策略 OOM 不能影响其他
策略调度:
→ 事件驱动架构:行情更新事件 → 触发相关策略
→ 优先级:做市策略优先于套利策略
→ 过载保护:策略执行超时怎么办 → 降级/跳过
参数配置:
→ 热更新:改参数不需要重启策略
→ 版本管理:谁改了什么参数、什么时候改的 → 审计
→ 回滚:参数配错了能一键回滚到上一个版本
面试高频问答
Q: How would you design a strategy parameter configuration system?
"Three principles:
1. Hot-reload: parameters must take effect without restarting the strategy.
I'd use a configuration center (like Nacos/Apollo) with a listener pattern —
when a trader updates their spread from 0.1% to 0.2%, the strategy instance
picks up the change within seconds.
2. Versioning & audit trail: every parameter change is logged with who changed
it, when, and the old vs new value. This is critical for post-mortem analysis
if a strategy loses money.
3. Validation & guardrails: the config service validates that parameters are
within safe ranges before accepting them. For example, an order size of
'100000 BTC' should be rejected at the API level, not discovered when
the strategy tries to place it."
6. Level 2 行情数据、WebSocket 行情推送、低延迟数据广播
通俗定义
| 概念 | 是什么 | 类比 |
|---|---|---|
| L1 行情 | 只有最优买卖价(买一、卖一) | 只告诉你"白菜 $2/斤" |
| L2 行情 | 前 N 档买卖价格+量 | 告诉你"卖1有100斤$2,卖2有200斤$2.1..." |
| WebSocket 推送 | 服务端主动推送给客户端,不轮询 | 餐厅 buzzer 响了 → 你的菜好了 |
| 增量推送 | 只推变化的部分 | "卖2-卖5没变,卖1从$2变成$1.99" |
业务价值
做市商需要 L2 深度来做决策——只看最优价不够。而且必须低延迟——行情延迟 100ms,做市商可能已经亏了。
后端开发关联
技术挑战:
1. 高并发连接:5000 个做市商同时订阅 → 每个一个 WebSocket 连接
2. 低延迟广播:盘口变化 → 推送给所有订阅者,p99 < 1ms
3. 增量 vs 全量:全量推送带宽爆炸,增量推送客户端需要状态同步
4. 消息可靠:做市商断连重连后,如何恢复到最新状态(snapshot + delta)
5. 背压控制:消费慢的客户端怎么办 → 断开 or 降速
常用方案:
→ LMAX Disruptor(RingBuffer 无锁队列)做行情分发
→ Aeron/UDP multicast 做极低延迟广播
→ 序列化选 SBE(Simple Binary Encoding)而非 JSON/Protobuf
面试高频问答
Q: How do you design a low-latency market data distribution system?
"The goal is to get order book updates from the matching engine to subscribers
in under 1 millisecond end-to-end.
Architecture:
1. Matching engine emits order book deltas (not full snapshots) to a Disruptor
ring buffer — lock-free, single producer, multiple consumers
2. Consumers (WebSocket gateways) read from the ring buffer and push to connected
clients. Each gateway handles ~10K connections via Netty (async I/O)
3. Binary encoding (SBE) instead of JSON — reduces payload from ~200 bytes
to ~40 bytes per tick, which matters at 100K messages/second
Edge cases:
- Slow consumers: if a client can't keep up, throttle or disconnect.
Never let one slow client block the entire broadcast.
- Reconnection: client sends the last known sequence number, server replays
missed deltas from an in-memory ring buffer or falls back to sending a
full snapshot if the gap is too large."
7. 事前风控、事中风控、熔断机制、仓位风险限制
通俗定义
| 阶段 | 检查内容 | 举例 |
|---|---|---|
| 事前 | 订单发出前 | "这笔订单量超过单笔上限?挂单价格偏离市场价>10%?" |
| 事中 | 订单执行中/持仓变化时 | "策略累积仓位超过上限?单日亏损超过阈值?" |
| 事后 | 交易完成后 | "策略盈亏和预期偏差太大?某账户交易频率异常?" |
| 熔断 | 触发阈值立刻停 | "策略 5 分钟内亏了$50K → 暂停策略所有订单" |
业务价值
做市商手里可能同时跑几十个策略、管理几百万美元仓位。没有风控 = 一个 bug 可能几分钟亏掉几个月的利润。
后端开发关联
风控系统架构:
Pre-trade Risk Gateway → 每笔订单必过,延迟必须 <100μs
Real-time Risk Monitor → 持续计算仓位/盈亏,延迟 <10ms
Circuit Breaker → 触发阈值后,50μs 内发出暂停指令
技术挑战:
→ 风控检查不能成为延迟瓶颈
→ 规则要热更新(紧急情况下不能等发布)
→ 熔断后要能快速恢复("fat finger"误触发怎么办)
面试高频问答
Q: How would you implement a pre-trade risk check without adding latency?
"Pre-trade risk must be ultra-fast — you can't add 5ms to every order.
The approach is:
1. In-memory risk rules — load all active rules into a local cache,
refreshed via config push (not polling). No database/cache lookup on
the hot path.
2. Pre-computed limits — for example, remaining position capacity is
updated asynchronously after each trade, so the pre-trade check only
needs a single 'if remaining >= orderQty' comparison.
3. Circuit breaker is just a boolean flag in memory.
Strategy risk breach → flip circuitBreakerOpen = true → all subsequent
orders from that strategy are rejected in nanoseconds.
4. If a check must query an external service, use a timeout < 1ms and
default to 'reject if timeout' — never let a slow risk check silently
pass a dangerous order."
8. 加密货币交易所 机构做市、自动化做市、跨市场对冲
通俗定义
机构做市:加密货币交易所 为专业做市商(如 Jump、Wintermute)提供专属 API、更低费率、更高下单频率限制。这些做市商跑的是自己的策略,通过 加密货币交易所 的流动性平台连接到交易所。
自动化做市:不是 AMM(Uniswap 那种链上池子),而是 加密货币交易所 提供策略引擎让做市商配置自动化策略。做市商不需要自己写代码部署系统,直接用 加密货币交易所 的平台配参数就行。
跨市场对冲:做市商同时在 加密货币交易所 和 大型加密货币交易所 交易同一币种。在 加密货币交易所 上挂卖单 → 成交了 → 立刻在 大型加密货币交易所 上买入对冲 → 赚取两个交易所之间的价差。
业务价值
机构做市商是流动性平台的核心客户——他们贡献了 70%+ 的盘口深度。平台的目标是让他们越做越爽:低延迟、低费率、好用的工具。
后端开发关联
你需要关注的:
1. Multi-tenant isolation:机构 A 的策略绝不能看到机构 B 的参数/仓位
2. API rate limiting:不同等级做市商有不同的下单频率上限
3. Cross-market data feeds:如果支持跨市场对冲,平台需要提供其他交易所的行情
4. Fee engine:Maker/Taker 费率因客户等级不同而不同
面试高频问答
Q: How does institutional market making differ from retail trading on 加密货币交易所?
"Institutional market makers are not manually clicking buy/sell.
They run automated strategies that submit thousands of quotes per second.
加密货币交易所 provides them with:
1. Dedicated API endpoints with higher rate limits and lower latency
2. Maker rebates — they pay negative fees (earn fees) for providing liquidity
3. A strategy engine platform where they can configure and run strategies
without deploying their own infrastructure
4. Risk management tools: position limits, circuit breakers, kill switches
From an engineering perspective, institutional traffic is fundamentally
different from retail traffic — it's high-frequency, low-latency, and one
misbehaving strategy can flood the system. So we need per-account rate limiting,
strict pre-trade checks, and tenant isolation."
速记卡片
| 编号 | 概念 | 一句话 |
|---|---|---|
| 1 | 流动性 | 能快速低成本交易大额 → 盘口深=流动性好 |
| 2 | Maker/Taker | 挂单等成交=Maker,吃掉已有挂单=Taker |
| 3 | 流动性平台 | 聚合做市商报价 → 统一订单簿 → 撮合交易 |
| 4 | 做市策略 | 交易员配参数 → 策略引擎自动挂单/调价/撤单 |
| 5 | 策略引擎 | 执行框架 = 调度 + 配置 + 风控沙箱 |
| 6 | L2/WS推送 | 前N档深度 + 增量推送 + 低延迟广播 |
| 7 | 风控 | 事前(发前检查) + 事中(持仓监控) + 熔断(阈值自停) |
| 8 | 机构做市 | 专业做市商API + 自动化策略平台 + 跨市场对冲 |