Comparing Trade Feeds to Detect Missing or Misordered Records
Summary
The document considers whether comparing stock trade data from two vendors reflects a real data-quality task. Vendors may report different records because trades are missing or erroneous, and their timestamps can vary when they reflect receipt time. That variation can also change the apparent order of events.
A basic check compares records by price and quantity, with timestamps available as context. A more involved, dynamic comparison could use neighboring trades to help identify whether feeds describe the same events despite differences in recorded timing or order. The discussion presents this as a plausible interpretation of an interview question, not a confirmed account of the intended problem. It does not specify a complete matching algorithm, tolerance rules, or how to handle ambiguous matches and additional vendors.
Key ideas
- Trade feeds from different vendors can disagree because records may be missing or erroneous.
- Vendor receipt timestamps can differ and can change the apparent event order.
- Comparing price and quantity provides a simple first check for matching trades.
- Neighboring records may help match trades when timing or ordering differs.
- The proposed interpretation of the interview question is speculative.
Tags
Full text
# Stock trading data across multiple vendors interview question # Stock trading data across multiple vendors interview question I had the following coding question in a quant shop interview recently. I have no experience with quant finance, so I was hoping to get some insight on if this problem actually represents some real world trading problem. Essentially, the question was something like this: > Suppose you have 2 vendors (can't remember if they used the term "vendor" or "exchange" but I don't think it matters for the problem) with different stocking trading data. Timestamps are given in the data. If the price and quantity are the same, then they're considered equal. This comparison can initially be done using a static comparison, and then using dynamic comparison. One followup was what if we allowed editing of the quantity and price? And another followup was adding additional vendors on top of the existing 2. There was a huge language barrier issue, and I spent a lot of time trying to figure out what the interviewer was asking me to code, and I still don't quite understand it. What I remember is mentioned above, and I was hoping someone can tell me if is modeled after some real world trading problem? ## Answer by Bob Jansen (score 1) https://quant.stackexchange.com/a/78205 I wasn't there so I can only guess but I think the below is reasonable: - Exchanges is where trades trade and in this context data vendors are often third parties that deliver historical data on all kind of stuff used by the quants so this might be interview question material; - It does happen that the data feeds don't exactly agree. Data can be missing or there can be other errors but you can certainly expect timestamps to differ if they record when the data is received by the vendor. The recorded order of events may change between vendors; - Before using the data you want to know it's accurate; - Therefore you could simply compare two trade feeds `trade1.price1 == trade2.price && trade1.quantity == trade2.quantity`. Maybe this was asked as a warm-up question; - You could further improve the matching by checking whether different orders were recorded by looking at the previous or next trades in the two feeds. Maybe this was meant by dynamic.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.