Design Point-in-Time Training Dataset Generation at Scale
Last updated: November 29, 2026
Quick Overview
Design the offline query system that takes a table of millions of (entity, timestamp, label) rows and a list of features, and returns a training dataset where every feature value is exactly what the online system would have returned at that timestamp, using the same feature definitions as serving.
Chalk
November 29, 20260
0
0 solved
Design the offline query system that takes a table of millions of (entity, timestamp, label) rows and a list of features, and returns a training dataset where every feature value is exactly what the online system would have returned at that timestamp, using the same feature definitions as serving.
Chalk's pitch is that one set of Python definitions produces both live values and temporally consistent training sets, so data scientists stop rewriting features in a second pipeline. The interviewer probes as-of joins at warehouse scale, how online-only resolvers are handled historically, and how you prove the two paths agree.
What the Interviewer Expects
- Distinguishes features backed by logged or historical data from ones that must be recomputed
- Uses partitioned, sorted as-of joins rather than per-row lookups
- Respects data availability time, not just event time, to avoid leakage
- Reuses the same resolver code and plan as the online path
- Plans incremental caching of computed historical values
- Validates consistency by comparing against logged online values
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- A resolver calls a third-party credit bureau API. How do you produce historical values for it?
- How would you size and partition the job for 500 million spine rows?
- How do you handle a feature whose definition changed six months ago?
- How would you surface leakage risk to the data scientist before they train?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Input: a spine of (entity_id, ts) (with labels), a feature list, optionally a branch. Output: a Parquet dataset with one row per spine row. Correctness: no information after ts. Scale: 10^8 to 10^...
High-Level Design
- Plan the same DAG the online planner would, then classify each node: (a) values that exist historically in the warehouse with timestamps, (b) Python transforms over other features, (c) online-o...