We use optional cookies for analytics and affiliate attribution. Essential cookies and marketing measurement are always on. Read our privacy policy

We just launched our Black Friday sale. You can use code BF2026 to get 25% off all subscriptions, valid until Nov 30th. There is a limit of 100 redemptions.

Logo

Internal and External ID Troubles

What this preview is

Internal and External ID Troubles is a medium quant coding problem on language knowledge in Cpp / Python, asked at Quant.

Difficulty
Medium
Topic
Language Knowledge
Discipline
Quant development
Languages
Cpp / Python

Detecting missing security-definition data in a trading system

This is a medium-difficulty coding problem that tests your ability to reconstruct a timeline from sparse, real-world trading data and validate it for consistency. It mirrors a common operational challenge at quantitative trading firms: reconciling external (exchange) identifiers with internal instrument identifiers when ingest pipelines fail silently.

The core task is to infer which calendar days are missing SecurityDefinition records for each critical instrument by examining the trades that were actually executed. You'll need to handle several data-quality issues: duplicate trade IDs, inconsistent security IDs within a single day, and out-of-order timestamps. Each validation failure should flip a flag rather than throw an exception, since invalid data affects only that instrument.

  • Grouping and aggregating sparse event logs by identifier
  • Inferring gaps in a timeline from observed events
  • Multi-criterion data validation with partial failure modes
  • Distinguishing between data quality issues (invalid flag) and missing coverage (streak length)

Solutions typically sort trades by timestamp, group by instrument ID, validate each group for the three error conditions, then iterate through the date range to count missing days and longest consecutive streak. Both C++ and Python are suitable; the challenge lies in clean handling of edge cases and efficient date arithmetic rather than language-specific tricks.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.