Detect Stale Bond Prices From Vendor Price Feeds
Last updated: November 29, 2026
Quick Overview
Given a table of daily vendor prices per security, find every security and vendor whose price has been unchanged for at least five consecutive pricing days up to and including its most recent price.
BlackRock
November 29, 20260
0
0 solved
Given a table of daily vendor prices per security, find every security and vendor whose price has been unchanged for at least five consecutive pricing days up to and including its most recent price.
Stale pricing is a classic data quality problem for a fixed-income-heavy platform like Aladdin, where illiquid bonds can carry the same evaluated price for days. A Data Operations Engineering screen would use it to test gaps-and-islands SQL and the judgment to separate a genuinely quiet bond from a broken feed.
What the Interviewer Expects
- Uses the gaps-and-islands pattern with two ROW_NUMBER sequences
- Restricts to the run that ends on the latest available date
- Partitions by both security and vendor
- Counts pricing days rather than calendar days
- Discusses why repeated prices after a change form a separate run
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you compare vendors to choose a primary price when one is stale?
- How would you handle holidays that differ by market?
- How would you turn this into an alert with a threshold that depends on asset class liquidity?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
Table vendor_prices(security_id, vendor, price_date, price), one row per security, vendor and pricing day (no weekend rows). I would ask whether missing days exist; I will treat 'consecutive' as con...
Approach
Gaps and islands: number rows per (security, vendor) by date, and separately per (security, vendor, price). Within an unbroken run of the same price both counters rise together, so their difference is...