Design a Top-Ten Trade Query with Exact Amounts
Citadel SecuritiesSoftware Engineer · Technical ScreenLast updated
Design a top-ten trade query around an explicit ranking contract, exact monetary aggregation, bounded heaps, timestamp boundaries, and mutable-score streaming tradeoffs.
Design a library that parses trade data and returns the top ten buys and sells. Explain the ranking contract, exact amount handling, object responsibilities, and a heap-based selection approach.
Constraints & Assumptions
The report does not state whether “top ten” means individual records, entities, quantities, or aggregated amounts, nor the time window or tie rule. Preserve those as required contract decisions. Do not invent a particular ranking metric or claim a unique output from the source alone.
Clarifying Questions
What is ranked and by which score? Are buys and sells separate lists? Is aggregation required? How are equal scores ordered? What data size, time tolerance/window, partial-fill, and streaming requirements apply?
Follow-up questions
- Why is a size-ten heap sufficient only after candidate scores are well defined? What changes if an entity's score can later increase or decrease? How can timestamp imprecision affect membership in a reporting window?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.