FastPrepOrder Book Data Validation
Problems/Order Book Data Validation

Order Book Data Validation

Jane Street logoJane Street● MediumFULLTIMENEW GRADONSITE INTERVIEW

Updated Nov 2025

QuestionConstraints

Problem statement

Source note: Seen in four Jane Street trading desk operations reports posted from 2021 to 2025, all about the last stage of interviews. A 2025 new-grad report from London describes an onsite round, mostly talk rather than code, about how to test that data held in several databases is consistent with how an order book works. A 2021 new-grad report from the U.K. says one of its final video rounds paired order matching with spotting errors in a set of data columns, partly in code. A 2023 U.S. report names order book validation as the topic of one of its three final rounds, and a 2025 London report says its in-office final included a data validation task after a design discussion; neither gives any details.

We turned the topic into one query over two tables, orders and fills. Treating the task as code rather than a discussion is ours. So is reading the 2023 report's order book validation round and the 2021 report's data columns as checks on order and fill records, and linking the 2025 London data validation task to order books; none of these three reports says what data was checked. The five checks (fills for an order that does not exist, fills before the order or after its cancel, fill prices worse than the limit, and orders filled past their size), allowing a fill at the exact time the order was created or cancelled, the table and column names, the output format and all the data are ours.

Our version is about 35% the same as the reported question.

An operations team keeps two tables from a trading system. The orders table has one row per limit order: its side ('B' to buy, 'S' to sell), its limit_price, the number of shares in quantity, the time it was created in created_ms and, if it was cancelled, the cancel time in cancelled_ms (NULL when it was never cancelled). The fills table has one row per execution against an order: the order_id it belongs to, the shares filled, the fill price and the fill time filled_ms. All times are milliseconds after midnight.

Before the data is used, it must pass these checks. Report one row for every failed check:

  • unknown_order: a fill whose order_id is not in orders. Such a fill gets no other check.
  • fill_before_order: a fill whose filled_ms is earlier than its order's created_ms.
  • fill_after_cancel: a fill on a cancelled order whose filled_ms is later than the order's cancelled_ms.
  • price_outside_limit: a fill on a buy order at a price above the limit price, or a fill on a sell order at a price below the limit price.
  • overfilled: an order whose fills add up to more shares than its quantity.

A fill at exactly the creation time, the cancel time or the limit price passes. For the first four checks, report table_name = 'fills' and record_id = the fill_id. For overfilled, report table_name = 'orders' and record_id = the order_id. A fill that fails several checks appears once per failed check. Return the columns table_name, record_id and issue, in any order.

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

orders

One row per limit order.

ColumnTypeNullableDescription
order_idPKIntegerNoUnique order ID.
sideTextNo'B' for a buy order, 'S' for a sell order.
limit_priceDecimalNoWorst price the order accepts.
quantityIntegerNoShares the order asks for.
created_msIntegerNoCreation time, milliseconds after midnight.
cancelled_msIntegerYesCancel time, or NULL if never cancelled.

fills

One row per execution against an order.

ColumnTypeNullableDescription
fill_idPKIntegerNoUnique fill ID.
order_idIntegerNoOrder the fill belongs to; it may be missing from orders.
quantityIntegerNoShares filled.
priceDecimalNoFill price per share.
filled_msIntegerNoFill time, milliseconds after midnight.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
table_nameTextNo—
record_idIntegerNo—
issueTextNo—

Row order: any order is accepted. Numeric tolerance: 0.

Constraints

  • Each table has between 1 and 1000 rows.
  • order_id values in orders are unique, and fill_id values in fills are unique.
  • side is 'B' or 'S'.
  • 1 <= quantity <= 1000000 in both tables.
  • 0 < limit_price, price <= 100000, with at most 4 digits after the decimal point.
  • 0 <= created_ms, filled_ms <= 86400000, and cancelled_ms is NULL or between created_ms and 86400000.
  • The answer has at least one row.

More Jane Street interview questions

  • Code Editor FoldingONSITE INTERVIEW · Seen Oct 2026
  • Exact-Sixty Dice Game ValueONSITE INTERVIEW · Seen Oct 2026
  • Expected Value of Modified DiceONSITE INTERVIEW · Seen Oct 2026
  • Spaceship Equipment LoadoutONSITE INTERVIEW · Seen Oct 2026
  • Two-Tower Strategy GameONSITE INTERVIEW · Seen Oct 2026
  • Wizard Scroll Allocation StrategyONSITE INTERVIEW · Seen Oct 2026
  • Sort TradesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026
  • Order Matching EngineONSITE INTERVIEW · Seen Jul 2026
  • Biggest Daily Move and Longest Rising StreakOA · ONSITE INTERVIEW · Seen Apr 2021
  • Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026

Similar questions at other companies

  • Daily USD Totals with Effective-Dated Exchange RatesMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Most Recent Order for Each CustomerCapgemini · ONSITE INTERVIEWCapgemini interview questions
  • Tenth-Highest Distinct SalaryInfosys · ONSITE INTERVIEWInfosys interview questions
  • Fifth Highest Salary In A DepartmentZS · ONSITE INTERVIEWZS interview questions
  • In-Memory Database QueriesOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Nth-Highest Distinct Salary Without Ranking FunctionsMastercard · ONSITE INTERVIEWMastercard interview questions
  • Contest Participants with Long Totals and Short QuestionsThe Walt Disney Company · ONSITE INTERVIEWThe Walt Disney Company interview questions
  • First Order per Merchant per DateAmazon · ONSITE INTERVIEW
  • Block Transaction Count TrendsChainalysis · ONSITE INTERVIEWChainalysis interview questions
  • Third-Highest Distinct SalaryExpedia · ONSITE INTERVIEWExpedia interview questions

Interview reports that mention this question

  • Jane Street TDO Earlier US Finals: 19 Experiences (Part 7 of 10)
  • Jane Street TDOE UK Final Round: 14 Experiences (Part 2 of 10)
  • Jane Street TDOE Interviews: 165 Experiences (Part 1 of 10)
  • Jane Street TDOE New Grad Interview Questions: 11 Experiences

Jane Street interview experiences

  • Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
  • Jane Street TDOE US Final Round: 11 Experiences (Part 5 of 10)
All Jane Street interview questionsSee Jane Street hiring insights