PracHub
QuestionsLearningGuidesInterview Prep
|Home/ML System Design/OpenAI

Design an ML search system with RAG

Last updated: Mar 29, 2026

Quick Overview

Design an ML search system with RAG evaluates ML product requirements, data/labeling, modeling, serving architecture, evaluation, monitoring, and trade-offs in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  • hard
  • OpenAI
  • ML System Design
  • Machine Learning Engineer

Design an ML search system with RAG

Company: OpenAI

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: hard

Interview Round: Technical Screen

Design an ML-powered enterprise search system using Retrieval-Augmented Generation (RAG). Context and constraints: - Corpus: 5M documents (avg 2 KB) from PDFs/web pages/tickets; updates must be searchable within 5 minutes. - Traffic: 300 QPS; multi-tenant with per-document ACLs. - SLOs: p95 latency ≤ 1.2 s end-to-end; budget ≤ $0.002 per query. Sub-questions: (a) Ingestion and chunking: parsing, deduplication, metadata extraction, embedding generation, chunk-size strategy, versioning, and incremental updates. (b) Indexing and retrieval: hybrid sparse+vector (BM25 + ANN), metadata filters, tenant isolation, query understanding/reformulation, top-k selection, and cross-encoder reranking. (c) Generation: prompt design, grounding with citations, constrained decoding, tool usage, streaming responses, and multilingual handling. (d) Guardrails and safety: hallucination reduction, citation enforcement, out-of-policy refusal, PII/security controls, and ACL-aware retrieval. (e) Evaluation and monitoring: offline metrics (NDCG@k, recall@k, answer faithfulness), online A/B tests, user feedback loops, drift/latency/cost monitoring. (f) Architecture and scaling: service decomposition, model hosting/batching, caching, vector store selection, backpressure, failover, and disaster recovery. (g) Cost and latency calculations: derive per-stage latency/cost, capacity plan for embeddings, ANN index size, and compute requirements. Justify model choices under constraints.

Quick Answer: Design an ML search system with RAG evaluates ML product requirements, data/labeling, modeling, serving architecture, evaluation, monitoring, and trade-offs in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Related Interview Questions

  • Design a Video Generation Service with GPU Fleet Management - OpenAI (medium)
  • Design a Text-to-Video Generation Platform (Sora-style) - OpenAI (hard)
  • Design a Text-to-Video Generation Service - OpenAI (medium)
  • Design a Text-to-Video Generation System - OpenAI (hard)
  • Design an Agent Harness and Evaluation System - OpenAI (medium)
|Home/ML System Design/OpenAI

Design an ML search system with RAG

OpenAI logo
OpenAI
Jul 15, 2025, 12:00 AM
hardMachine Learning EngineerTechnical ScreenML System Design
56
0

Design an ML search system with RAG

System Design: ML-Powered Enterprise Search with RAG

Design an ML-powered enterprise search system using Retrieval-Augmented Generation (RAG) under the following context and constraints.

Context and Constraints

  • Corpus: 5M documents (avg 2 KB each) sourced from PDFs, web pages, and support tickets.
  • Freshness: Updates must be searchable within 5 minutes end-to-end.
  • Traffic: 300 QPS, multi-tenant with per-document ACLs (users/groups/roles).
  • SLOs: p95 latency ≤ 1.2 s end-to-end; budget ≤ $0.002 per query.

Assume textual content (no heavy images), standard enterprise auth (OIDC/SAML), and typical query lengths (short questions/keywords). If not stated, make minimal, reasonable assumptions to complete the design.

Sub-Questions

(a) Ingestion and chunking: Describe parsing, deduplication, metadata extraction, embedding generation, chunk-size strategy, versioning, and incremental updates.

(b) Indexing and retrieval: Propose a hybrid sparse+vector approach (BM25 + ANN), metadata filters, tenant isolation, query understanding/reformulation, top-k selection, and cross-encoder reranking.

(c) Generation: Outline prompt design, grounding with citations, constrained decoding, tool usage, streaming responses, and multilingual handling.

(d) Guardrails and safety: Methods for hallucination reduction, citation enforcement, out-of-policy refusal, PII/security controls, and ACL-aware retrieval.

(e) Evaluation and monitoring: Offline metrics (e.g., NDCG@k, recall@k, answer faithfulness), online A/B tests, user feedback loops, and drift/latency/cost monitoring.

(f) Architecture and scaling: Service decomposition, model hosting/batching, caching, vector store selection, backpressure, failover, and disaster recovery.

(g) Cost and latency calculations: Derive per-stage latency/cost, capacity plan for embeddings, ANN index size, and compute requirements. Justify model choices under the constraints.

Constraints & Assumptions

  • Preserve the scope, facts, inputs, and requested outputs from the prompt above.
  • If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
  • Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.

Clarifying Questions to Ask Guidance

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers Guidance

  • A scoped requirements summary with concrete non-goals and success metrics.
  • ML-specific data, model, evaluation, serving, and monitoring choices.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions Guidance

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More ML System Design•More OpenAI•More Machine Learning Engineer•OpenAI Machine Learning Engineer•OpenAI ML System Design•Machine Learning Engineer ML System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.