Free answer · mid level
This answer is free. It is 1 of the 100 questions and 127 diagrams in the Forward Deployed Engineer pack.
Get the whole pack for ₹999 · $20, or all nine for ₹3,000 · $49.Get the whole pack as a PDF you keep, or all nine packs in one payment.
UPI, cards or netbanking. Card or PayPal, in US dollars. One PDF, in My packs the moment you pay.
Why it is asked
The interviewer wants to see that you treat the model as one part of a system, and that you know the parts that make it safe and operable in a customer's environment.

The answer
I would build five layers around the model, because the model is the smallest part of the system: a gateway, retrieval, the model itself, guardrails, and logging with evals.
- Gateway: every request enters through one service. It checks the user's single sign-on token (SSO, for example an Okta OIDC token, verified locally against Okta's published signing keys), applies rate limits per user and team, and picks which model to call.
- Retrieval: documents from Confluence and SharePoint are split into chunks, turned into embeddings (lists of numbers that capture meaning) and stored with each chunk's access list in a search index such as Elasticsearch. We use hybrid search, keyword (BM25, a classic word-matching score) plus vectors, because exact terms such as error codes and policy numbers are missed by embeddings alone, then re-rank the top results. A sync job re-indexes changed documents and their access lists on a schedule. The user's permissions are a filter in every search.
- Model: a hosted model such as Claude or GPT, always called through the gateway, so we can swap models without touching the app.
- Guardrails: checks before the model (PII, prompt injection, off-topic requests) and after it (leaked data, missing citations, policy).
- Logging and evals: every call writes a trace (prompt version, retrieved chunk IDs, tokens, latency, cost) to a tool like Datadog, plus an audit record. A sample of answers is scored every day against a quality rubric.
Conversation history and feedback go into Postgres.
The gateway and the logs make this operable: when quality drops or cost jumps, we see which prompt version and documents were involved, and can switch it off in one place.
What the interviewer listens for
- Names the five layers: gateway, retrieval, model, guardrails, logging and evals.
- Single gateway for auth, quotas, model routing and the kill switch.
- Hybrid keyword plus vector search with re-ranking; permissions travel with the chunks.
- Traces carry prompt version, chunk IDs, tokens and cost so problems can be traced.
- Model is swappable because the app never calls it directly.
Follow-ups the interviewer may ask
- Why not let the frontend call the model API directly? Hint: you lose central auth, quotas, logging, key safety and the kill switch.
- Why hybrid search instead of vectors only? Hint: embeddings miss exact strings such as error codes and policy numbers; BM25 catches them, and a re-ranker orders the merged list.
- How would this change for an agent that takes actions? Hint: add a tool gateway with least-privilege scopes and human approval for writes.
Common mistakes
- Drawing only "app, vector DB, LLM" and forgetting identity, logging and guardrails.
- Filtering permissions after the model has answered.
- Hard-coding one vendor's SDK across the codebase so the model cannot be changed.
Written by Roni Das, who builds distributed systems and AI systems for a living.
Learn it properly
This is taught step by step in the course lesson LLM Observability and Tracing: Seeing Inside a Nondeterministic System.
One question is not enough for the interview.
This is 1 of the 100 questions in the Forward Deployed Engineer pack
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (127 diagrams in all). A PDF you keep, junior to staff level.
Pay by UPI, cards or netbanking through Razorpay. Pay by card or PayPal, in US dollars. Download at once from My packs.
More free questions from this pack
- What is a forward deployed engineer, in your own words? (junior)
- How is an FDE different from a product software engineer, a solutions engineer and a consultant? (junior)
- What does a typical week look like for an FDE? (junior)
- Why do you want to be a forward deployed engineer? (junior)
- A customer says: "We want AI for our support team." What do you do in the first meeting? (mid)
- A hospital network asks you to reduce emergency department wait times. You have two weeks and access to their data. Break the problem down. (mid)
- What questions do you ask on the first technical call with a customer? (junior)
- Your integration needs to call a customer's API. When do you use the OAuth 2.0 client credentials grant, and when the authorization code grant? Whose identity does the access token carry in each case? (mid)
- The customer's admin offers you a global admin account "to save time". What do you ask for instead, and why? (junior)
- Your connector writes tickets into the customer's system. A request timed out, the connector retried, and now there are duplicate tickets. How do you make the writes safe to retry? (mid)
- What are input and output guardrails in an LLM application? Give examples of each. (junior)
- Before rolling out an LLM support assistant, how would you build the evaluation set, and how do you decide it is good enough to ship? (mid)
- The customer wants RAG over 10 million documents, all behind their firewall. Size it for me on the whiteboard. (senior)
- One deployment of your AI platform must serve 50 business units of the same enterprise. How do you design multi-tenancy? (staff)
Free questions from the other packs
- A page calls 100 backend servers in parallel and waits for all of them. Each server is slow only 1% of the time. How often is the page slow, and what can you do about it? (System Design)
- Design a URL shortener like bit.ly. What are the requirements and the API, what happens when a link is created and when it is clicked, and should the redirect be a 301 or a 302? (System Design)
- Your call to the payment provider times out. Did the customer pay? How do you design the payment state machine and reconciliation so no money is lost or charged twice? (System Design)
- Walk me through a UPI person-to-person payment. What do the payer's app, the PSP, the NPCI switch and the two banks each do? (System Design)
- You must move a 600-million-row orders table from MySQL to DynamoDB, where data is modeled around access patterns instead of joins. How do you migrate with no downtime and prove the new model answers every query? (System Design)
- What do temperature and top-p control, and what values would you use for data extraction versus brainstorming? (AI Engineering)
- What is hybrid search, and how do you merge keyword and vector results with Reciprocal Rank Fusion? (AI Engineering)
- Users ask "list all X" questions and RAG returns only five items. Why, and what do you do? (AI Engineering)
- How do you check that an LLM judge agrees with human reviewers? (AI Engineering)
- Cut the cost of an LLM feature serving 10 million requests a day by 60% without hurting quality. Walk through your plan. (AI Engineering)
- Why are LLMs bad at counting letters or reversing a word? (GenAI and LLM)
- Write out scaled dot-product attention with the shape of every tensor. (GenAI and LLM)
- How does speculative sampling keep exactly the target model's distribution? (GenAI and LLM)
- What is GRPO, and how do verifiable rewards train reasoning models? (GenAI and LLM)
- Design a system that answers questions from 300-page contracts accurately. (GenAI and LLM)
- Describe the basic agent loop. (Agentic AI)
- What are pass@k and pass^k, and why do they matter for agents? (Agentic AI)
- How does prompt injection become dangerous once the agent has tools? (Agentic AI)
- Design the security architecture for an agent that can read and send company email. (Agentic AI)
- Design a customer support agent for an e-commerce company. (Agentic AI)
- What happens, step by step, when an LLM server handles one request? (Inference Engineering)
- Derive the KV cache size formula and work it out for Llama 3 70B. (Inference Engineering)
- What is PagedAttention? (Inference Engineering)
- When does speculative decoding stop helping or make things worse? (Inference Engineering)
- Design a service to serve Llama 3 70B at 10 QPS with latency targets. (Inference Engineering)
- A model scores 95% accuracy offline but users say it is useless. What do you check first? (ML Engineering)
- How do you train on a dataset that does not fit in memory? (ML Engineering)
- A long distributed training job dies at hour 20. How do you make training fault tolerant? (ML Engineering)
- How does request batching on a GPU trade latency for throughput? (ML Engineering)
- An online model metric dropped 8% overnight. How do you debug it? (ML Engineering)
- You need to show delivery times for 20 cities. Would you use histograms, box plots, violin plots or ECDFs, and why? (Data Science)
- A test is 99% accurate and you test positive. What is the chance you have the disease? (Data Science)
- What share of first-time buyers make a second purchase within 30 days? Write the SQL. (Data Science)
- How would you forecast daily orders for the next four weeks, and how do you know the forecast is any good? (Data Science)
- A coupon A/B test shows a small average lift. How do you find which users the coupon actually works for, and who should get it next time? (Data Science)
- Compute the cosine similarity of a = (3, 4) and b = (4, 3) by hand. What does the result mean? (Maths for ML)
- A batch of 32 MNIST images goes into a dense layer with 128 units. What are the shapes, and what is the rule for when two matrices can be multiplied? (Maths for ML)
- A disease affects 1% of people. A test catches 90% of sick people (sensitivity) and wrongly flags 9% of healthy people (false positive rate). You test positive. What is the chance you are sick? (Maths for ML)
- Why do we not use mean squared error for classification with a sigmoid output? Compare the gradients numerically. (Maths for ML)
- Compute scaled dot-product attention by hand for two tokens with d_k = 2. (Maths for ML)
