AI EXPLORERS HUB

Interview prep

AI Engineer

Builds products on models: retrieval, tools, agents, and the checks that keep them honest.

These questions are representative practice, not from a specific company. Use them to rehearse how you think. A real interview will ask about your own work.

  1. What is the difference between a model, a prompt, and an application?

    Hint. Separate the weights, the instructions, and the software around them.

    Reveal answerHide answer

    The model is the trained system that takes text in and returns text or tool calls. The prompt is the instructions and context you send on one request. The application is everything else: auth, retrieval, tools, storage, UI, and the checks that decide whether the output is safe to show.

  2. How does retrieval augmented generation work?

    Hint. Name the index, the query, and what you paste into the prompt.

    Reveal answerHide answer

    You split documents into chunks, embed them, and store the vectors. At question time you embed the question, fetch the nearest chunks, and put those passages in the prompt so the model answers from them. The model still writes the reply. Retrieval only supplies evidence.

  3. When would you skip retrieval and just call the model?

    Hint. Think about whether the answer lives in your documents.

    Reveal answerHide answer

    Skip retrieval when the task is rewriting, classification of the text the user already sent, or a general explanation that does not depend on private docs. Add retrieval when the answer must match your policies, tickets, or product facts, or when being wrong is expensive.

  4. How do you evaluate a retrieval system before you tune the prompt?

    Hint. Score the passages, not only the final paragraph.

    Reveal answerHide answer

    Build a small set of real questions with the passages that should have been found. Measure whether those passages land in the top results. If retrieval misses, a better prompt will not fix the answer. Only then score the written reply for faithfulness to the passages you returned.

  5. Your agent can write and run code. How do you keep that safe?

    Hint. Limit where the code runs and what it can touch.

    Reveal answerHide answer

    Run every job in an isolated container or VM, not on the host. Block outbound network by default and keep keys out of that sandbox. Cap time, memory, and disk. Require a person to approve deletes, deploys, and payments. Log commands and outputs so you can replay what happened.

  6. Costs keep rising. How do you cache without serving a stale or wrong answer?

    Hint. Cache only what is truly the same, and say when it expires.

    Reveal answerHide answer

    Put the stable system prompt and tool list first so prompt caching can reuse that prefix. Cache exact repeats keyed by model, prompt version, and normalized input. Use a semantic cache only with a high bar you tested. Drop entries when data, prompts, or models change, and never share one user's cached answer with another.

  7. What is tool calling?

    Hint. The model proposes an action. Your code performs it.

    Reveal answerHide answer

    You describe functions the model may call, with names and arguments. The model returns a structured call instead of guessing the result. Your server runs the function, checks permissions, and sends the result back. The model then writes the reply. The model should not be the thing that hits production systems directly.

  8. How do you stop an agent from looping?

    Hint. Budgets and a stop condition, not hope.

    Reveal answerHide answer

    Cap the number of steps, tokens, and dollars. Stop when the model says it is done, when a tool returns a terminal result, or when the same call repeats. If it hits the cap, return a partial result and the trace, and ask a person before continuing.

  9. How would you add streaming to a chat feature?

    Hint. The user should see tokens as they arrive, and tools still have to finish.

    Reveal answerHide answer

    Stream tokens over server-sent events or a chunked HTTP response. Show a partial reply immediately. If the model requests a tool, pause the visible stream, run the tool, then continue. Persist the final message only after the stream ends, and handle a dropped connection by letting the user retry.

  10. How would you design memory across sessions?

    Hint. Separate the transcript from the few facts worth keeping.

    Reveal answerHide answer

    Keep the raw transcript for a short window. Extract a small set of facts the user confirmed, with a time and a source. Load only those facts into the next session, not the whole history. Let the user see and delete memory. Do not store secrets or guesses as if they were facts.

  11. How do you turn thumbs up and down into real improvements?

    Hint. A thumb is a label, not a training plan.

    Reveal answerHide answer

    Store the prompt, the retrieved passages, the reply, and the thumb. Read the downs and group them: wrong fact, bad tone, refused a fair request, or too slow. Add those cases to an eval set. Change the prompt, the index, or the tool, then rerun the set. Do not fine-tune on a handful of thumbs.

  12. What belongs in the system prompt, and what belongs in the user message?

    Hint. Rules that never change versus the task for this turn.

    Reveal answerHide answer

    The system prompt holds role, rules, and output shape that should apply every turn. The user message holds the question and the data for this request. Retrieved passages are context, not a new identity. If a rule must survive a long chat, keep it in the system prompt, because later user text can crowd it out.

  13. How do you choose a chunk size for a document index?

    Hint. A chunk should answer one question without dragging in a whole chapter.

    Reveal answerHide answer

    Start around a few hundred tokens with a small overlap, then test on real questions. Too small and the passage loses the definition it needed. Too large and you pay for irrelevant text and crowd out other hits. Judge by whether the right fact appears in the top results, not by a round number.

  14. A user says the bot invented a policy. What do you check first?

    Hint. Look at the passages that were actually in the prompt.

    Reveal answerHide answer

    Open the trace. If the policy was not in the retrieved text, the model filled the gap. Tighten the instruction to answer only from the passages and to say when they are missing. If the passage was there and the reply still changed it, add that case to the eval set and fix the prompt or the citation check.

  15. Design a support bot over about 10,000 internal docs.

    Hint. Walk through ingest, question time, and what you refuse.

    Reveal answerHide answer

    Ingest docs on a schedule, chunk and embed them, and record the source URL and updated time. At question time, retrieve a few passages, answer with citations, and refuse when the passages do not cover the question. Log the query, the hits, and the reply. Start with an eval set of real tickets before you open it to everyone.

  16. Tell me about something you shipped that failed.

    Hint. Use a real project. Name the signal, the fix, and what you changed in the process.

    Reveal answerHide answer

    Pick one launch. Say what you expected, what the logs or users showed, and the smallest change that stopped the harm. Then say what guard you added so the same miss would be caught by a test next time. Interviewers want the loop, not a story where nothing was your fault.

All roles · Jobs

Add AI Explorers Hub to your home screen and check Today in AI whenever you want a fresh briefing.