← Voleon Interview InsightsSoftware Engineer

Voleon·Software Engineer·Onsite - Coding / Algorithms·Senior

SeniorPrefer not to say
May 2026

Summary

Long OOP coding session at Voleon building the market-data foundation layer for a simulated broker/exchange system. The session was heavy on design tradeoffs and API contracts, with the expectation that downstream trading logic would consume whatever you built here.

Questions Asked (4)

Q1

Design and implement a market-data feed that ingests a stream of ticks (timestamp, symbol, side, price, size) and maintains, per symbol, the current best bid and best ask. Define the core classes including a Symbol value object, an OrderBookSnapshot with methods like best_bid(), best_ask(), mid_price(), and a MarketDataFeed with on_tick() and get_snapshot().

System DesignAlgorithms & Data StructuresAPI & Integrations
Author's notes

This was the bulk of the session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and assumptions (e.g., single-threaded, in-memory, tick-by-tick updates) and then define the core classes with clear responsibilities. Focus on the data structures and algorithms that maintain best bid/ask efficiently, and discuss trade-offs and edge cases. Finally, outline how you would test and extend the design.

Pro tip: Mention that you would use a priority queue or balanced BST for each side of the book, but also note that for top-of-book only, a simple two-variable update per symbol suffices—this shows you can balance simplicity and performance.

1. Clarify requirements and assumptions

Ask about expected throughput, latency, concurrency, and whether only top-of-book is needed. State assumptions like single-threaded, in-memory, and tick-by-tick updates.

2. Define core classes and interfaces

Design Symbol as an immutable value object, OrderBookSnapshot with methods best_bid(), best_ask(), mid_price(), and MarketDataFeed with on_tick() and get_snapshot().

3. Choose data structures for order book maintenance

For each symbol, maintain best bid and best ask. If only top-of-book, use two variables; if full depth, use a max-heap for bids and min-heap for asks, or a balanced BST.

4. Implement on_tick and snapshot logic

on_tick updates the appropriate side's best price/size based on side and price comparison. get_snapshot returns an immutable snapshot of current best bid/ask.

5. Discuss edge cases, testing, and extensions

Handle empty book, crossed book, duplicate timestamps, and symbol not found. Outline unit tests and mention potential extensions like full depth, concurrency, or persistence.

Key Points to Mention

  • Immutable Symbol value object with proper equals/hashCode for use as map key.
  • OrderBookSnapshot as an immutable view to ensure thread-safety and consistency.
  • Efficient update of best bid/ask: O(1) for top-of-book only, O(log n) for full depth with heaps.
  • Handling of edge cases: empty book, crossed market, invalid side, unknown symbol.
  • Separation of concerns: MarketDataFeed manages symbols and delegates to per-symbol order books.
  • Testing strategy: unit tests for tick processing, snapshot correctness, and performance under load.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

What data structures would you use for per-symbol tick processing, and what are the time complexities of on_tick() and get_snapshot()?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Talked through a per-symbol dict mapping price to aggregated size, plus the heap on top for O(1) best-price reads after O(log n) updates.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: per-symbol tick processing likely involves high-frequency updates and snapshot queries. Propose a data structure like a hash map from symbol to a per-symbol structure (e.g., a ring buffer or deque for recent ticks, plus running aggregates). Then analyze the time complexity of on_tick() and get_snapshot(), considering whether operations are O(1) amortized or O(k) for snapshot size.

Pro tip: Mention that the choice depends on the snapshot definition: if it's the latest tick, O(1) is possible; if it's an aggregate over a window, you might need a more complex structure like a balanced tree or a circular buffer with incremental updates. Also, consider concurrency if ticks arrive from multiple threads.

1. Clarify requirements

Ask whether snapshots are point-in-time (latest tick) or windowed aggregates, and whether ticks are processed concurrently. This determines the appropriate data structures and complexity.

2. Propose primary data structure

Suggest a hash map (e.g., unordered_map) mapping symbol to a per-symbol structure. For per-symbol, use a ring buffer (circular array) for fixed-size recent ticks, or a deque for variable size, plus running aggregates (e.g., sum, count) for O(1) updates.

3. Analyze on_tick() complexity

on_tick() involves updating the per-symbol structure: appending to buffer (O(1) amortized) and updating aggregates (O(1)). If using a balanced tree for ordered statistics, it could be O(log n).

4. Analyze get_snapshot() complexity

get_snapshot() depends on snapshot definition: if it returns latest tick, O(1); if it returns aggregate over window, O(1) if precomputed; if it returns all recent ticks, O(k) where k is snapshot size. Mention trade-offs.

5. Discuss trade-offs and alternatives

Compare with alternatives like balanced trees (O(log n) updates, O(log n + k) snapshots) or skip lists. Highlight that the chosen structure optimizes for the common case (frequent ticks, occasional snapshots).

Key Points to Mention

  • Hash map for symbol lookup with O(1) average time.
  • Ring buffer or deque for efficient tick storage with O(1) append and bounded memory.
  • Running aggregates (e.g., sum, count, min, max) for O(1) snapshot of statistics.
  • Time complexity: on_tick() O(1) amortized; get_snapshot() O(1) for aggregates or O(k) for full window.
  • Trade-offs: memory vs. speed, and handling out-of-order or late ticks.
  • Concurrency considerations: locks or lock-free structures if multi-threaded.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How would you handle stale ticks or out-of-order timestamps in the feed?

System DesignTechnical Trade-offs
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data source and the impact of stale/out-of-order data on downstream consumers. Then propose a layered solution: detection (watermarks, sequence numbers), handling (buffering, windowing, dropping), and monitoring. Emphasize trade-offs between latency, completeness, and correctness, and how you'd validate the approach.

Pro tip: Mention that you'd first check if the feed is at-least-once or exactly-once, and whether the system can tolerate duplicates or requires idempotent processing. This shows you understand the business context before jumping to technical fixes.

1. Clarify requirements and constraints

Ask about the feed's semantics (e.g., at-least-once, exactly-once), the acceptable latency, and how stale/out-of-order data affects downstream consumers. This ensures you design the right solution.

2. Detect stale and out-of-order events

Use sequence numbers, timestamps, or watermarks to identify events that are late or out of order. Consider using event-time processing with a bounded out-of-orderness threshold.

3. Handle detected events

Choose a strategy: drop stale events, buffer and reorder within a window, or process with corrections (e.g., retractions). The choice depends on correctness vs. latency trade-offs.

4. Ensure idempotency and consistency

If duplicates or reprocessing occur, make downstream operations idempotent. Use deduplication keys or transactional writes to avoid double-counting.

5. Monitor and iterate

Track metrics like late event rate, watermark lag, and dropped events. Set alerts and adjust thresholds based on observed data patterns.

Key Points to Mention

  • Watermarks and event-time vs. processing-time semantics
  • Windowing strategies (tumbling, sliding, session) with allowed lateness
  • Trade-offs between latency, completeness, and cost
  • Idempotent processing and deduplication techniques
  • Backpressure and buffering to handle bursts of out-of-order events
  • Monitoring and alerting on stale/out-of-order metrics

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would downstream trading logic consume this API, specifically for reading snapshots and reacting to top-of-book changes?

API & IntegrationsSystem Design
Author's notes

The subscribe/callback pattern came up here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer around two distinct consumption patterns: pull-based snapshot reads for state initialization/reconciliation, and push-based event streams for real-time top-of-book updates. Emphasize the need for a consistent, versioned data model and clear delivery semantics (e.g., at-least-once with sequence numbers) to handle out-of-order or duplicate messages. Conclude by discussing how downstream systems can combine both to maintain a correct, low-latency view of the market.

Pro tip: Demonstrate awareness of the trade-off between latency and consistency: snapshots are authoritative but stale, while incremental updates are fast but can drift. Propose a periodic snapshot reconciliation to bound drift, and mention that sequence numbers enable gap detection and recovery.

1. Define the API contract and data model

Describe the snapshot format (e.g., full order book state with sequence number) and the top-of-book change event schema (e.g., symbol, bid/ask price/size, timestamp, sequence). Clarify that both share a common versioned schema to ensure compatibility.

2. Snapshot consumption pattern

Explain how downstream logic fetches snapshots via a REST or gRPC call, validates the sequence number, and initializes its local state. Mention the need for retries, timeouts, and handling of stale snapshots.

3. Top-of-book change subscription

Detail how the downstream subscribes to a WebSocket or server-sent event stream for incremental updates. Discuss processing each event in order, applying updates to the local book, and emitting signals when the top-of-book changes.

4. Consistency and recovery

Explain how to detect gaps or out-of-order events using sequence numbers, and how to recover by re-fetching a snapshot. Emphasize idempotent processing and periodic reconciliation to prevent drift.

5. Performance and scalability considerations

Discuss batching, backpressure, and concurrency (e.g., per-symbol processing) to handle high throughput. Mention monitoring for latency and correctness, and the use of in-memory data structures for fast access.

Key Points to Mention

  • Sequence numbers for ordering and gap detection
  • Snapshot + incremental update pattern for state synchronization
  • Delivery semantics: at-least-once, idempotent processing, and deduplication
  • Latency vs. consistency trade-offs and periodic reconciliation
  • Backpressure and flow control in streaming updates
  • Schema versioning and backward compatibility

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.