← Citadel Interview Insights

Citadel·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Citadel SWE interview with a finance-flavored data structures problem. The question was more domain-specific than I expected but the core logic wasn't too bad once I figured out what they actually wanted.

Questions Asked (1)

Q1

You're given a list of order records as 4-tuples (exchange ID, price, quantity, order type). Implement a QuoteBook class that supports two methods: one returning the best bid and best ask for a specific exchange, and another returning the national best bid and offer across all exchanges. Best bid is the highest bid price, best ask is the lowest ask price, and if multiple orders share the best price, their quantities should be summed. Return None for a side if no orders exist for it.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The finance terminology threw me off at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify requirements and edge cases, then design a data structure that efficiently maintains per-exchange order books and a global view. Implement the QuoteBook class with methods for per-exchange and national best bid/offer, ensuring correct aggregation of quantities at the best price levels.

Pro tip: Discuss the trade-offs between different data structures (e.g., heaps vs. sorted maps) and how they affect performance for high-frequency updates, showing awareness of real-world trading systems.

1. Clarify Requirements and Edge Cases

Ask about input format, update frequency, and whether orders can be modified or cancelled. Confirm that 'best bid' means highest price and 'best ask' means lowest price, and that quantities at the same price are summed.

2. Design Data Structures

Propose maintaining a separate order book per exchange, each with a data structure for bids and asks (e.g., sorted maps or heaps). Also maintain a global order book aggregating all exchanges for national best bid/offer.

3. Implement Per-Exchange Query

For a given exchange, retrieve the best bid and ask from its order book. If multiple orders at the best price, sum their quantities. Return None if no orders on that side.

4. Implement National Best Bid/Offer Query

Aggregate orders across all exchanges to find the highest bid and lowest ask nationally. Sum quantities at the best price levels. Return None if no orders exist on a side.

5. Analyze Complexity and Trade-offs

Discuss time and space complexity of operations, and trade-offs between different data structures (e.g., heaps for O(1) best price vs. sorted maps for ordered traversal). Mention potential optimizations for high-frequency updates.

Key Points to Mention

  • Use of appropriate data structures (e.g., heaps, sorted maps, or balanced BSTs) for efficient best price retrieval.
  • Handling of multiple orders at the same price by summing quantities.
  • Maintaining separate per-exchange books and a global book for national best bid/offer.
  • Edge cases: empty order book, no bids or asks, and orders with zero quantity.
  • Time and space complexity of each operation and overall system.
  • Trade-offs between different implementations (e.g., update vs. query performance).

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