AI engineering · 24 concepts
GenAI engineering: LLMs, RAG, agents and evals
Build and run LLM features: tokens, RAG, agents and tools, evals, cost and serving, and AI security, the way GenAI engineer interviews ask them.
Asked in these mock interviews
Part 1 · 5 concepts
LLM basics for builders
- 01
Tokens and the context window
A token is a piece of text from the model's tokenizer, often part of a word. Cost, rate limits and the context window are all counted in tokens, and the window holds…
- 02
Temperature, top-p and repeatable answers
The model gives a probability for every next token. Temperature and top-p change how the next token is picked, but even temperature zero does not promise the same…
- 03
Why models make things up, and prompt, RAG or fine-tune
A model predicts likely text and has no built-in check against a source of truth, so it can invent facts. The builder reduces this by supplying facts and checking…
- 04
Prompts that work, and reviewing a prompt
A good prompt states the task, audience and format, separates instructions from data, gives reasons and examples, and is changed only when an eval shows it helped.
- 05
Reliable JSON and structured output
Asking for JSON in the prompt fails sometimes. Structured output with a schema, or a tool call, makes the shape reliable, but your code must still check that the values…
Part 2 · 6 concepts
Retrieval-augmented generation
- 06
Embeddings and similarity search
An embedding turns text into a list of numbers so that similar meaning gives nearby vectors. Search finds the nearest vectors, and the model that made the vectors must…
- 07
Parsing, chunking and the ingestion pipeline
RAG quality starts at ingestion: parse the file well, cut it into chunks that make sense alone, attach metadata, embed, and index. A change in the source file can…
- 08
Where to store vectors: pgvector, vector databases and filters
A team can keep vectors in PostgreSQL with pgvector, or use a dedicated vector database or a search engine. Filtered search with an approximate index has a known trap…
- 09
Hybrid search, fusion and reranking
Vectors find meaning and keyword search finds exact words. Hybrid search runs both and merges the lists, often with reciprocal rank fusion, and a reranker then orders…
- 10
Access control, fresh versions and Indian languages in RAG
RAG must show each user only what they may see, answer from the right version of a document, and work for Hindi and Hinglish questions. All three need metadata and…
- 11
Debugging and designing a RAG system
When a RAG answer is wrong, split the problem into retrieval and generation using the trace, then fix the stage that failed. A full design adds ingestion, versions…
Part 3 · 4 concepts
Agents and tools
- 12
Tool calling and tool design
In tool calling the model asks for a function call with JSON arguments, and your code runs it and returns the result. Good tools are built around user tasks with clear…
- 13
The agent loop, workflows and limits
An agent is a model in a loop that chooses actions. Code must set hard limits, and many tasks are better as a fixed workflow where code controls the steps.
- 14
MCP, memory and multi-agent systems
The Model Context Protocol is an open way to connect tools to AI apps. Memory design keeps long chats useful and cheap, and several agents are worth it only where…
- 15
Agents that act: rules in code and human approval
An agent that can spend money or change data needs business rules inside its tools, risk-based human approval and a design that covers hand-off, logging and measurement.
Part 4 · 3 concepts
Evaluating LLM apps
- 16
Golden sets, eval scripts and prompt changes
An eval is a set of test questions with expected facts that runs before every prompt, model or config change. It scores retrieval and answers separately and blocks…
- 17
LLM-as-a-judge and RAG metrics
A model can grade outputs against a rubric, but it has known biases. Calibrate it against human labels, and use the RAG metrics (faithfulness, context relevance, answer…
- 18
Testing in production and evaluating agents
Offline evals are not enough. Roll out with shadow mode, a canary and an A/B test with a business metric, and evaluate agents on the end state, the path and consistency.
Part 5 · 3 concepts
Cost, speed and serving
- 19
Latency, streaming and voice
A call has a wait for the first token and then a steady stream of output tokens. Measure each stage, stream to the user, and set a budget per step for voice.
- 20
Prompt caching, routing, rate limits and batch jobs
Cut cost and survive limits with a stable prompt prefix for caching, routing easy requests to smaller models, careful retries, and batch processing for jobs that can…
- 21
Self-hosting, GPU memory and quantisation
Self-hosting an open-weights model gives control and steady cost at high load, but you own GPUs and operations. Weights and the KV cache decide what fits on a GPU, and…
Part 6 · 3 concepts
Safety, privacy and running in production
- 22
Prompt injection and unsafe outputs
The model cannot reliably tell instructions from data, so any text in its context can act as an instruction. Defend by limiting what the system can do, not by asking…
- 23
Guardrails and personal data in AI features
Guardrails are checks on inputs and outputs, built from code first, then small classifiers, then model checks. Personal data sent to a hosted model needs mapping…
- 24
Running an LLM feature: cost, latency and failures
In production, LLM features fail through cost, latency and wrong promises. A good response finds the cause from data, stops the damage, fixes it and adds a check so it…
Your first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.