Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan

Diagnose RAG Failures by Layer

HardGenerative AI & LLMs00:00
Practice interviewer
In session
5 left
00:00

Your question is Diagnose RAG Failures by Layer. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Context

FinSure offers an internal support copilot that answers customer-service questions using policy manuals, billing procedures, and compliance FAQs. A large enterprise customer reports that answer quality is inconsistent, but it is unclear whether the root cause is the prompt, retrieval pipeline, or underlying model.

Constraints

  • p95 latency: 2,500ms end-to-end
  • Cost ceiling: $0.03 per request and $18K/month at 20K requests/day
  • Hallucination rate: <2% on a labeled golden set
  • Prompt injection success rate: <1% on adversarial tests
  • The system must cite retrieved sources for factual claims and refuse when evidence is insufficient

Available Resources

  • 120K internal documents (PDFs, HTML help center pages, policy docs, ticket macros)
  • Existing hybrid search stack (BM25 + dense vector search) and document metadata
  • Three approved models: a small fast model, a mid-tier model, and a premium model
  • 400 historical customer questions with human-rated answers, plus 50 known-bad examples from the customer
  • Access to prompt templates, retrieval logs, ranked results, and model outputs

Task

  1. Propose a step-by-step diagnosis plan that isolates whether failures are caused by prompt design, retrieval quality, or model capability.
  2. Define an offline and online evaluation strategy, including how you would build a golden set, measure groundedness, and detect prompt injection or unsupported answers.
  3. Recommend an architecture and experimentation plan to test prompt-only, retrieval-only, and model-only changes while respecting latency and cost constraints.
  4. Write a production-quality prompt and Python implementation for a diagnostic harness that runs ablations and returns structured root-cause signals.
  5. List the most important failure modes, mitigations, and tradeoffs you would communicate to the customer and internal stakeholders.