Skip to content

    Forward Deployed Engineer

    Enterprise RAG Design Exercise With a Scored Answer

    A worked answer to an enterprise retrieval design question for a fictional distributor, covering access control, conflicting sources and a scoring rubric.

    By Published 6 min read

    Share

    This lesson is part of FDE Interview: Answer Framework and Design Exercises. Enroll for free, then sign in, to read it in full.

    What you'll learn: how to answer an enterprise RAG design question in the six-step framework, where access control and conflict handling belong, and how to score the answer against a rubric.

    At a glance

    Figure 1. The worked answer: ingestion and query paths

    Worked answer for an enterprise RAG assistantDocument store to Worker (documents); Worker to Search index (chunks, tags); Client app to API gateway (question); API gateway to Orchestrator (user, role); Orchestrator to Retriever (question, role); Retriever to Search index (filtered query); Orchestrator to Model gateway (evidence); Model gateway to LLM provider (prompt); Orchestrator to Trace store (trace); Eval service to API gateway (replay set)INGESTION (ASYNCHRONOUS)QUERY PATHDocument store: files, metadataDocument storefiles, metadataWorker: chunk and tagWorkerchunk and tagSearch index: keyword firstSearch indexkeyword firstRetriever: access filterRetrieveraccess filterClient appClient appAPI gateway: identityAPI gatewayidentityOrchestrator: answer or refuseOrchestratoranswer or refuseModel gatewayModel gatewayLLM providerLLM providerTrace storeTrace storeEval service: question setEval servicequestion setdocumentschunks, tagsquestionuser, rolequestion, rolefiltered queryevidenceprompttracereplay set

    How to read this: dashed arrows are asynchronous work (ingestion and tracing), solid arrows are calls the user waits for, and the access filter sits inside the Retriever, not after it.

    • Access control is a filter inside the retrieval query, set by code from the user's identity.
    • No evidence means no answer.
    • Conflicting current documents are both named; superseded ones are filtered out.
    • Quality is measured on a hand-labelled question set.

    Scenario

    Composite scenario, not a real company. Lumen Industrial Supply, a fictional distributor, has about 30 product documents (datasheets, FAQs, compatibility notes) and a catalog of 40 products. One document is partner-only, two documents disagree on one specification, and one datasheet has been superseded. Sales engineers, some employed by partners, ask product questions. The interviewer says: "Design the assistant, and tell me how you would know it works." All figures are illustrative.

    What you will be able to do

    • Answer an enterprise RAG prompt in six steps.
    • Place access control inside the retrieval query and say why a post-filter fails.
    • Name four failure modes and a check for each.
    • Score the answer on five criteria.

    Prerequisites

    Core ideas

    Step 1 and 2: clarify, then fix constraints

    Question If the answer is... Then the design...
    Who may see which documents? Public and partner users Filter by role inside retrieval
    What does a wrong answer cost? A wrong spec reaches a quote Refuse, and cite
    Do documents change? Yes, new revisions Chunks carry a status
    How many questions? 1,200 a day One synchronous path

    Step 3: the design

    Ingestion splits documents at headings and tags each chunk with source, SKUs, status and visibility. The orchestrator decides before retrieval (Figure 2); the model gateway sees only retrieved text and the question.

    Figure 2. What the orchestrator does with one question

    flowchart TD accTitle: Query-time decisions for one question accDescr: A question and the user role come in. If the question is out of scope, or its words are not covered by documents this user may see, the assistant refuses. If the request is not specific enough, it asks a clarifying question. Otherwise it retrieves with the access filter and superseded documents excluded. If current sources disagree, the answer states the conflict and cites both. Otherwise it answers with citations. Q["Question and user role"] --> S{"In scope and covered by documents this user may see?"} S -- no --> R["Refuse: cannot answer from the documents"] S -- yes --> A{"Specific enough?"} A -- no --> K["Ask a clarifying question"] A -- yes --> F["Retrieve with access filter, superseded excluded"] F --> C{"Do current sources disagree?"} C -- yes --> D["Answer, state the conflict and cite both"] C -- no --> N["Answer with citations"]

    How to read this: each diamond is a decision made by code before the model writes anything, and the first two exits stop before any answer is written.

    Step 4: trade-offs

    Decision Default Switch when
    Search Keyword first: part numbers match literally Wording differs: add vector search
    Chunking Split at headings Answers missed in long sections: add overlap
    Filter Inside the query Never after retrieval
    Weak evidence Refuse, using a coverage threshold Users reject refusals: tune the threshold

    Step 5 and 6: failure modes and measurement

    Failure What the user sees Caught by
    Partner-only text reaches a public user A leaked answer Access-control test cases, target zero leaks (capstone, 36 questions: 5 leaks without the filter, 0 with it)
    Superseded datasheet cited An outdated figure A status tag excluded in retrieval, and a test on known revisions
    Two documents disagree Silent choice of one A conflict case in the question set
    No relevant document A confident guess Unanswerable questions, refusal rate

    The refusal check is a cheap heuristic: in the capstone it reaches 97.2% refusal accuracy on 36 questions, and one question that should be refused (q36) gets clarifying questions.

    In the interview: say the failure table aloud and name the number you would watch first.

    Worked example

    Score with the framework lesson's rubric (weak 0, acceptable 1, strong 2).

    Criterion Strong looks like Score
    Clarifying Questions tied to decisions 2
    Access control Filter inside the query 2
    Evidence and conflicts Refusal, conflicts, versions 2
    Failure modes Listed with user impact 2
    Measurement Question set, metric, threshold 1

    Total 9 of 10. Measurement lost a point because the question set had no size. Strong adds: "thirty-six hand-written questions, six unanswerable, four access-control, release blocked on any leak".

    Assumptions (all illustrative):

    • 1,200 questions a day, 1,400 words of prompt each, 1.4 tokens per word, 250 output tokens.
    • Placeholder prices of 1 and 5 euros per million input and output tokens (fill in your provider's published price).

    Input is 1,400 x 1.4 = 1,960 tokens, so a day uses 2.352 million input and 0.3 million output tokens: 2.35 + 1.50 = 3.85 euros.

    Practice task

    Answer a variant in 35 minutes.

    1. Prompt: "Lumen's support team answers warranty questions from contracts and manuals. Design the retrieval assistant." Contracts are per customer.
    2. Write the six step headings with the framework's time boxes.
    3. Draw where the customer filter is applied.
    4. List four failure modes and a check for each, then score yourself.

    Exercise

    Spot the flaw. A candidate says: "The service retrieves the top five chunks for the question, then removes any chunk the user may not see, and sends the rest to the model. If fewer than five remain, the model answers from what is left and fills any gap from its general knowledge."

    Answer

    Two defects. Filtering after retrieval can leave zero allowed chunks, and gap-filling from general knowledge produces uncited claims. Fix: filter inside the query, and refuse when evidence is thin.

    Task: rewrite the sentence to score strong. Done when it applies the filter inside the query from the caller's role, uses only retrieved text, and refuses on thin evidence.

    Hint 1: where does the filter run?

    What is lost when the filter runs after retrieval?

    Hint 2: who decides the role?

    The authenticated request, set by code, not the model.

    Common mistakes

    • Saying "access control" without where it runs.
    • Choosing a vector database before seeing the questions.
    • No refusal path, so unanswerable questions get guesses.
    • Naming metrics without a test set or a threshold.

    Knowledge check

    1. Why is the access filter applied inside the query rather than on the results?

    A post-filter can discard most top results and ranking can leak restricted text. A filter inside the query ranks only allowed documents.

    2. Two documents disagree on one specification. What should the answer do?

    It says they disagree and cites both. A superseded document is different: its status tag keeps it out of retrieval.

    3. Why start with keyword search for this prompt?

    Part numbers are literal strings. Add vector search after measuring misses: it is one more component to run.

    4. What does "strong" measurement look like in this answer?

    A sized question set, a metric per failure, and a release-blocking threshold such as zero leaks.

    5. When would you not refuse on weak evidence?

    When measurement shows wrong refusals that make users distrust the tool. Then tune the threshold.

    You can now

    • Answer an enterprise RAG question in six steps.
    • Explain why the filter runs inside the query.
    • Describe how conflicts, superseded documents and missing evidence are handled.

    Further reading

    Last verified: 2026-11-02

    Next

    Design exercise 2: an agentic workflow

    Enroll to keep reading

    Lesson 2 of 6 · FDE Interview: Answer Framework and Design Exercises

    A worked answer to an enterprise retrieval design question for a fictional distributor, covering access control, conflicting sources and a scoring rubric.

    In the rest of this lesson

    • Worked example
    • Practice task
    • Exercise
    • Common mistakes
    • Knowledge check
    • You can now

    Enrolling is free. It unlocks every lesson in FDE Interview: Answer Framework and Design Exercises, tracks your progress across devices and keeps your quiz scores. The newsletter is optional.

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments