Phase 2: Company-Specific | Category: OpenAI-Specific
OpenAI Is Different: The Mental Model Shift
At Meta, you’re a data engineer supporting product analytics. At Netflix, you’re supporting streaming infrastructure. At Google, you’re building on GCP. At OpenAI, data engineering IS the product. The training data, RLHF signal, evaluation datasets, and fine-tuning pipelines you build directly determine whether GPT-5 is better than GPT-4. There’s no downstream “business team” using your pipeline — your pipeline shapes the AI model that 800M+ weekly users interact with.
This creates a fundamentally different interview dynamic. Per DataInterview.com: “The highest-stakes work sits in the RLHF pipelines that shape model behavior after pre-training, plus the evaluation dataset ingestion that lets the evals team run automated scoring.” But there’s also “a genuinely unusual meta-layer where you build pipelines that call OpenAI’s own APIs as transformation steps — using LLMs to classify or enrich data flowing through them.” You’re not just building pipelines for AI. You’re building pipelines WITH AI.
OpenAI’s Infrastructure Context
Scale and stack:
- ChatGPT: 800M+ weekly active users (as of 2025)
- Infrastructure: Azure (Microsoft partnership) + custom GPU clusters
- Primary compute: Azure OpenAI, custom training clusters (Stargate program — 2M+ AI chips)
- Data storage: Azure Blob Storage / S3 equivalents, Snowflake for analytics
- Processing: Spark, Ray for distributed data processing
- Orchestration: Airflow + custom internal tooling
- Training: PyTorch + custom distributed training on GPU clusters
What OpenAI’s data engineers actually build:
Pipeline TypeDescriptionPre-training dataWeb-scale text collection, deduplication, quality filtering, tokenization at 100TB+ scaleRLHF dataHuman feedback collection, preference data modeling, reward model training dataFine-tuning datasetsDomain-specific data curation, format conversion, quality validationEvaluation pipelinesBenchmark dataset management, automated scoring, human eval dataUsage analyticsChatGPT usage metering, API usage tracking, billing dataRAG pipelinesDocument ingestion, chunking, embedding, vector store managementLLM-as-transformerUse GPT-4 to classify/enrich data flowing through pipelines
The OpenAI Interview: What Differentiates It
Per DataInterview.com and Interview Query:
Interview process (4-6 weeks):
| Stage | Format | Focus |
|---|---|---|
| Recruiter screen | 30 min phone | Background, mission alignment, compensation |
| Technical screen | 60 min video | Python + SQL, ETL pipeline concepts, distributed systems |
| Onsite Round 1 | 60 min | Coding (Python data structures, pipeline logic) |
| Onsite Round 2 | 60 min | SQL + data modeling |
| Onsite Round 3 | 60 min | System design (AI data infrastructure focus) |
| Onsite Round 4 | 45 min | Behavioral + mission alignment |
L4 (Senior) vs L5 (Staff) difference per DataInterview.com: “L4 interviews emphasize strong coding, deep knowledge of data structures and algorithms, and practical experience with systems like Spark and Kafka. L5 interviews shift heavily toward large-scale data systems design, architectural trade-offs, and leadership.” The comp difference is significant: ~$651K at L4 vs ~$910K at L5.
What interviewers probe at senior/staff level:
-
LLM integration into data pipelines (not just traditional DE)
-
Training data pipeline design at 100TB+ scale
-
RLHF data infrastructure
-
Data quality for model training (failures here = worse model)
-
Evaluation pipeline design
-
Privacy, safety, and governance at AI scale
-
Cost optimization for GPU-adjacent compute
Pre-Training Data Pipeline: The Foundation
Pre-training is how LLMs learn language from internet-scale text. The data engineering challenge: process hundreds of TB of raw web data into a high-quality, diverse, deduplicated training corpus.
The pipeline stages:
WEB
CRAWL (Common Crawl, proprietary crawls) ↓ ~PB-scale raw HTML + text [EXTRACTION] • HTML parsing → clean text extraction • Language detection (fastText/langdetect) • Encoding normalization (UTF-8) ↓ [QUALITY FILTERING] • Perplexity filtering (too high = gibberish, too low = templated/repetitive) • Heuristic filters: min/max doc length, fraction of special chars, ratio of alphabetic chars, duplicate sentence ratio • LLM-based quality classifier: "Is this document educational and high quality?" → Use GPT-3.5 to score documents (LLM-as-transformer pattern) ↓ [DEDUPLICATION] — Most critical step for training quality • URL-level dedup: remove exact URL duplicates • Document-level: MinHash LSH for near-duplicate detection (Jaccard similarity threshold ~0.7) • Paragraph-level: hash-based dedup within documents • Why critical: Memorization/training instability from repeated data ↓ [PII REMOVAL] • Named Entity Recognition to detect PII • Pattern matching: emails, phone numbers, SSNs, credit cards • Replace with placeholders: "[EMAIL]", "[PHONE]" • Never delete — replace — to preserve document structure ↓ [TOXICITY FILTERING] • Classifier to detect and remove harmful content • Category-specific thresholds (hate speech stricter than mild profanity) • Sampling review: human reviewers audit random samples per category ↓ [TOKENIZATION + FORMATTING] • Apply tokenizer (BPE/tiktoken) to produce token sequences • Pack sequences to fill context window length (e.g., 8192 tokens) • Output: training shards in TFRecord/WebDataset format ↓ [DATASET VERSIONING] • Tag each dataset version with hash of all component versions • Lineage: source → filters applied → dedup strategy → tokenizer version • Immutable once published for training run
Scale reality: At 100TB of clean text, the MinHash deduplication step is the hardest. LSH (Locality Sensitive Hashing) with MinHash reduces O(n²) pair comparisons to O(n log n) but still requires hundreds of GB of LSH index in memory. This runs as a distributed Spark job across hundreds of workers.
RLHF Data Pipeline: The Alignment Layer
RLHF (Reinforcement Learning from Human Feedback) is what makes ChatGPT helpful, harmless, and honest rather than just a next-token predictor. By 2025, OpenAI’s compute allocation was “70-80% mid-training + RL” per FundaAI. Data engineering for RLHF is now as important as pre-training data.
The RLHF data pipeline:
PROMPTS
(user queries, internal datasets, red-teaming prompts) ↓ [MODEL SAMPLING] • N responses sampled from current model for each prompt (typically N=2-8) • Stored with: prompt_id, model_version, sampling_params, response_text, timestamp ↓ [HUMAN LABELING] • Labelers compare response pairs: "Which response is better and why?" • Binary preference or ranked preference (1st, 2nd, 3rd, etc.) • Quality control: inter-annotator agreement tracking per labeler • Labeler metadata stored: labeler_id, label_time, confidence, expertise_area ↓ [PREFERENCE DATA MODELING] Grain: one row per comparison (prompt_id, response_A_id, response_B_id, preferred) pref_comparisons table: comparison_id, prompt_id, model_version, response_a_id, response_b_id, winner_id, labeler_id, label_timestamp, confidence_score, is_quality_controlled, is_included_in_training ↓ [REWARD MODEL TRAINING DATA] • Clean preferences: remove low-confidence, disputed labels • Balance across dimensions: helpfulness, safety, honesty • Version the training split (train/val/test) deterministically ↓ [PPO TRAINING DATA] (Proximal Policy Optimization) • Use reward model to score model responses • Label high-reward completions for policy improvement • Store: prompt, completion, reward_score, policy_version
Data quality gates before training run (the interview question from DataInterview.com):
Before
any training run is allowed to start: ✓ Dataset size meets minimum threshold (e.g., > 100K comparisons) ✓ Inter-annotator agreement > 75% on held-out gold set ✓ No single labeler accounts for > 5% of labels (diversity requirement) ✓ Safety category balance (not all helpfulness, some safety labels) ✓ Deduplication check (< 1% near-duplicate prompts) ✓ Version tag matches expected hash (immutable dataset) → If any gate fails: block training run, alert RLHF team
RAG Pipeline Design: The Production LLM Pattern
RAG (Retrieval-Augmented Generation) is how LLM-powered products access knowledge beyond their training cutoff. Building production RAG pipelines is a core OpenAI DE skill.
Document ingestion pipeline:
SOURCE
DOCUMENTS (PDFs, web pages, databases, code repos) ↓ [EXTRACTION] • PDF: pdfplumber, pypdf for text, OCR for scanned docs • HTML: BeautifulSoup, Trafilatura for main content • Code: language-aware chunking (by function, class) • Schema-on-read: store raw extracted text + metadata ↓ [CHUNKING STRATEGY] — The most important RAG design decision • Fixed-size: 512 tokens with 50-token overlap → Simple, works well for most documents • Semantic: split at paragraph/section boundaries → Better context preservation, variable chunk size • Recursive: hierarchically split by paragraph, then sentence, then token → Best quality, most complex • Document-specific: code by function, legal by clause ↓ [EMBEDDING GENERATION] — Compute-heavy • Call embedding API (text-embedding-3-large: 3072 dims) • Or run embedding model locally for cost savings at scale • Store: chunk_id, document_id, chunk_text, embedding_vector, metadata ↓ [VECTOR STORE INGESTION] • Index embedding in vector DB: Pinecone, Weaviate, pgvector, Qdrant • ANN index: HNSW (Hierarchical Navigable Small World) for < 10ms retrieval • Metadata filters: document_id, source, date, access_level ↓ [LINEAGE TRACKING] — Critical for production RAG For each answer generated: Store: answer_id, query, retrieved_chunks[], chunk_ids[], embedding_model_version, prompt_template_version, llm_model_version, timestamp Purpose: "Why did the model say that?" must be answerable from stored lineage
The lineage question from DataInterview.com:
“Would you store this lineage in an append-only event log or in a relational schema attached to each response row?”
Model answer: “Both, serving different purposes. An append-only event log (e.g., CloudEvents schema → Kafka → Iceberg) captures the complete retrieval and generation trace for each request — immutable audit trail, supports replay. A relational schema on the response row stores the denormalized key fields (chunk_ids, model versions, prompt template hash) for fast query-time lookup: ‘Show me all responses that used document X.’ The event log is the source of truth; the denormalized fields are a query-optimized projection. Non-negotiable fields: chunk_ids[] (what was retrieved), embedding_model_version (embeddings change meaning when model changes), prompt_template_version (prompt change = behavior change), llm_model_version (model change = answer change), retrieval_timestamp (point-in-time snapshot of the document state used).”
LLM-as-Transformer: The OpenAI-Unique Pattern
This is the most distinctive aspect of OpenAI DE work: using OpenAI’s own models as transformation steps in the data pipeline.
Example: LLM-based data quality classifier in the pre-training pipeline:
on
def classify_document_quality(document_text: str) -> float: """ Use GPT-3.5 to rate document educational quality. Returns score 0-1. """ response = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[{ "role": "user", "content": f"""Rate the educational quality of this text on a scale of 0.0-1.0. Consider: Is it informative, well-written, and factually accurate? Respond with only a number. Text: {document_text[:2000]}""" }], temperature=0, max_tokens=5 ) return float(response.choices[0].message.content.strip())
Practical considerations for LLM-as-transformer:
- Cost: GPT-3.5-turbo at $0.002/1K tokens. For 1B documents × avg 500 tokens → $1M. Must be selective about what gets LLM-classified vs heuristic filters.
- Latency: ~500ms per API call → batch async requests, use tiktoken for cost estimation before calling
- Reliability: API calls can fail → retry with backoff, maintain a dead-letter queue for failed items
- Versioning: When the LLM version changes, classifications can change → version your dataset with the model version used
- Idempotency: Cache API results by document hash — same document returns same classification regardless of how many times pipeline re-runs
The Evaluation Pipeline: Measuring Model Quality
Every model change requires evaluation to quantify impact. The eval pipeline is critical infrastructure.
BENCHMARK
DATASETS (MMLU, HumanEval, internal red-team datasets) ↓ versioned and immutable in object storage [EVALUATION RUNS] • Submit model API calls for each benchmark item • Store: eval_id, model_version, benchmark_id, item_id, prompt, model_response, correct_answer, score • Parallelized across thousands of items simultaneously ↓ [METRIC COMPUTATION] • Accuracy per category, aggregate scores • Statistical significance vs baseline model • Regression detection: did any capability get worse? ↓ [HUMAN EVALUATION] • Random sample sent to human labelers • Side-by-side comparison: new model vs baseline • Win/tie/lose rate computed ↓ [REGRESSION GATING] Before any model ships: ✓ Automated eval score ≥ baseline on all benchmarks ✓ No statistically significant regression on safety benchmarks ✓ Human eval win rate ≥ baseline → Gate: model cannot ship if any gate fails
OpenAI-Specific Interview Questions
Q1 (from DataInterview.com): “Design an end-to-end pipeline that produces a high-quality fine-tuning dataset for ChatGPT from user conversations, including PII redaction, dedup, and toxicity filtering. Specify your storage layers, idempotent reprocessing strategy, and the data quality checks you would block on before a training run.”
Model Answer: “I’d design this in four layers.
Ingestion and storage: Raw conversations stored in immutable append-only storage (S3 or Azure Blob) partitioned by date. Every conversation gets a deterministic conversation_id (hash of user_id + session_id + start_timestamp). This is the bronze layer — never modified after write.
PII redaction pipeline (must happen before any human reviewers see data): Spark job reads from bronze, runs a PII detection model (Microsoft Presidio or custom fine-tuned NER) to identify and replace PII entities — names, emails, phone numbers, addresses. Replaced with typed placeholders: [PERSON], [EMAIL]. Stores to silver layer, also immutable. The key: redact at bronze→silver transition so PII never enters the labeled data pipeline.
Quality filtering pipeline: Three passes. First: heuristic filters (minimum length, language detection, remove incomplete conversations). Second: LLM-based quality score (using GPT-3.5 to score “Is this a helpful conversation worth learning from?” on a sample — too expensive to run on all). Third: toxicity classifier to flag conversations with harmful content for exclusion or special handling.
Deduplication: MinHash LSH at conversation level (deduplicate near-identical conversations from A/B test users seeing the same prompts). Store dedup fingerprints in a persistent hash store (Redis or DynamoDB) for incremental pipeline runs.
Gold layer: Cleaned, deduplicated, PII-redacted conversations in Parquet, versioned by dataset_version tag (hash of all processing versions: PII model version + quality model version + dedup params).
Idempotency: Pipeline processes by conversation_id. Re-running produces same output — PII redaction is deterministic, dedup fingerprints are stored persistently (second run checks fingerprint store and skips already-processed conversations), quality scores are cached by conversation_id.
Quality gates before training run:
-
Row count ≥ minimum threshold for the fine-tuning task
-
PII redaction coverage check: scan 0.1% sample with a stricter PII model — if false-negative rate > 0.01%, block and improve the redaction model
-
Toxicity scan: reject if > 0.5% of conversations exceed toxicity threshold
-
Language distribution: no single language accounts for > 80% (diversity requirement)
-
Dedup check: < 2% near-duplicate pairs in final dataset
-
Dataset hash matches expected version — immutability verification
If any gate fails: block the training run, create an incident ticket with the specific failure metric, notify the fine-tuning team. No training run starts on a dataset that hasn’t passed all gates.”
Q2: “How would you design the data infrastructure for OpenAI’s evaluation system that runs thousands of evals daily across multiple model versions?”
Model Answer: “The evaluation system has three distinct data flows that need different treatment.
Benchmark storage: Immutable versioned datasets stored in object storage (S3/Azure Blob), version-tagged by dataset_hash. Each benchmark item has: item_id, prompt, expected_answer, category, difficulty. Benchmark datasets are NEVER modified — only new versions created. This ensures reproducibility: you can always re-run evals on exactly the same data.
Eval execution pipeline: A distributed job queue (Ray or Celery) submits benchmark items as tasks to the target model API. Each task: (item_id, model_endpoint, model_version, sampling_params). Results stored in a time-series database with: eval_run_id, model_version, item_id, response, score, latency_ms, timestamp. The eval_run_id is deterministic (hash of benchmark_version + model_version + eval_params) — idempotent re-runs produce same results.
Metric aggregation: dbt models on top of the results table compute accuracy per category, per model version, per benchmark. INFORMATION_SCHEMA for lineage — any analyst can trace ‘GPT-4.1 scored 92% on MMLU math’ back to exactly which items, which responses, and which scoring function produced it.
Regression detection: For each new model version, the system computes delta vs the prior production model on all benchmarks. A regression alert fires if any category drops > 2% (statistical significance check using Fisher’s exact test). This alert BLOCKS the model from being deployed to production APIs.
Human eval integration: A sample of side-by-side comparisons (new model vs baseline) is routed to labelers via a task queue. Results stored in the same database, joined to the automated eval results for a combined quality picture.
Cost management: Eval runs against GPT-4 cost real money. Rate limit eval jobs to off-peak GPU hours. Cache eval results by (item_id + model_version) — if you re-run an eval on the same model with the same item, serve from cache. Estimated cost: 10K eval items × avg 1K tokens × $0.03/1K tokens = $300 per eval run — manageable but worth monitoring.”
Think About This
You’re preparing for the OpenAI system design round. The most likely prompt is one of:
-
“Design a pipeline to produce a high-quality fine-tuning dataset from ChatGPT conversations” (Day 38)
-
“Design the data infrastructure for evaluating model quality” (covered above)
-
“Design an enterprise search system with RAG” (uses LLM-as-transformer pattern)
Before Day 38, mentally sketch:
-
How does the LLM-as-transformer pattern change your pipeline design vs traditional ETL?
-
What are the unique data quality requirements when the output feeds an LLM training run vs a BI dashboard?
-
How do you version a training dataset so the same experiment is exactly reproducible 6 months later?
-
What’s the blast radius if PII leaks through the redaction layer into the training data?
Quick Reference: OpenAI-Specific
- Core DE areas: Pre-training data pipelines (PB-scale dedup, quality filtering), RLHF data (preference collection, reward model training data), eval pipelines (benchmark management, regression detection), RAG pipelines (chunking, embedding, vector store), usage metering
- The LLM-as-transformer pattern: Use GPT-3.5 to classify/enrich data in your pipeline. Cost/quality trade-off: use LLM for the ~10% of items where heuristics aren’t enough
- RLHF data model grain: one row per comparison (prompt, response_A, response_B, preferred). Quality gates before training: inter-annotator agreement, label diversity, dedup rate
- RAG lineage non-negotiables: chunk_ids[], embedding_model_version, prompt_template_version, llm_model_version, retrieval_timestamp — all must be stored per-answer
- Data quality gates are blocking: unlike analytics pipelines where bad data is annoying, bad training data creates worse models that ship to 800M users. Gates must BLOCK training runs, not alert.
- Dataset immutability: training datasets are NEVER modified after publishing for a run. Version by hash of all processing components. Re-create as new version when logic changes.
- Interview differentiator: Understanding the “meta-layer” — using LLMs inside data pipelines — and the specific data quality requirements that differ when the consumer is a model training run vs a business analyst.
Tomorrow’s Preview
Day 38: Design: LLM Training Data Pipeline — Full end-to-end system design for building a high-quality fine-tuning dataset for ChatGPT at scale. Web data processing, deduplication at 100TB+, PII removal, quality filtering, RLHF preference data collection, and the training-run quality gates that block bad data from reaching the model. The practical application of everything from Day 37.