Atlas
203 concepts, each explained the same way
What it is and why it exists → the quick prototype → production at scale → vendors and the AWS way → how it fails → what an interviewer asks next. Concepts marked “lab” link to something you can poke.
LLM fundamentals
What actually happens between a prompt and a token: tokenization, sampling, the KV cache, latency, structured output, tool calling.
- Tokens & tokenizationcorelabModels read and write integer tokens, not characters — and you pay, wait and run out of context per token.
- Context windowscorelabThe maximum tokens a model can attend to in one call — input and output together.
- Sampling: temperature, top-k, top-pcorelabHow the next token is picked from the model’s probability distribution.
- EmbeddingscorelabFixed-length vectors that place similar meanings close together.
- KV cachecorelabThe stored keys and values of every past token, so generation doesn’t recompute them.
- Latency: TTFT and tokens/scorelabTime to first token is what users feel; output tokens per second is how long the rest takes.
- Structured outputscorelabGetting JSON that matches a schema every time, not most of the time.
- Tool / function callingcorelabThe model emits a structured request to call your function; your code runs it and returns the result.
- StreamingcorelabSend tokens to the user as they’re generated instead of waiting for the whole answer.
- Prompt cachingcorelabReuse the processed prefix of a prompt across calls: cheaper and faster input.
- Reasoning modelscoreModels trained to think (generate hidden reasoning tokens) before answering.
- Transformer basics at interview depthAttention, prefill vs decode, mixture-of-experts and positional encodings — enough to reason about cost and behaviour.
- HallucinationcoreFluent, confident output that isn’t supported by facts or the given context.
- Logprobs & confidenceToken-level probabilities you can use as a (rough) confidence signal.
- Determinism and reproducibilityWhy the same prompt at temperature 0 can still give different answers.
- Multimodal inputsImages, PDFs and audio as model input — and what they cost in tokens.
- Choosing a modelcorePick on your eval set, then on latency, cost, context, and where the data may go.
Prompting & context engineering
What goes into the window, in what order, and what gets cut when it doesn’t fit.
- System promptscoreThe standing instructions: role, rules, tone, tools and output format.
- Few-shot examplescoreShow, don’t tell: a few input→output examples in the prompt.
- Assembling and budgeting the contextcorelabDeciding what goes in the window, in what order, and how many tokens each part may take.
- Compaction & summarisationcorelabShrinking long histories so long tasks keep fitting in the window.
- Long context vs RAGcoreSend everything, or retrieve the right part? Depends on size, change rate, cost and permissions.
- Instruction hierarchySystem > developer > user > content: who gets to give orders.
- Just-in-time context & progressive disclosureLet the agent fetch what it needs through tools instead of preloading everything.
- Prompt versioning & templatesPrompts are code: version them, review them, test them, roll them out gradually.
- Chain-of-thoughtAsking the model to reason step by step before answering — helps some tasks, hurts others.
RAG end to end
Parsing, chunking, indexing, hybrid retrieval, reranking, permissions, citations, freshness and how to measure all of it.
- Document parsingcorelabTurning PDFs, slides, HTML and scans into clean text with structure — the step most RAG quality is lost in.
- ChunkingcorelabSplitting documents into retrievable pieces — big enough to make sense alone, small enough to be precise.
- Contextual chunk headersPrepend a short description of where a chunk comes from before embedding and indexing it.
- Parent-child (small-to-big) retrievallabSearch over small chunks for precision, hand the model the bigger section for context.
- Choosing embedding modelsDimensions, languages, domains, cost — and the rule that you can’t mix them.
- Vector indexes: HNSW, IVF, flatcorelabApproximate nearest-neighbour structures that trade a little recall for a lot of speed.
- Vector quantisation & storage mathslabfloat32 → int8 → binary, product quantisation, and why a billion vectors is a budgeting problem.
- BM25 (keyword search)corelabThe classic ranking function: rare terms that appear often in a short document score high.
- Hybrid search (BM25 + dense)corelabRun keyword and vector search together and fuse the rankings.
- RerankingcorelabA slower, smarter model reorders the top candidates.
- Query rewritinglabTurn what the user typed into what the index can answer.
- Metadata filters & per-user permissionscorelabRetrieval must only return what this user may see — enforced in the query, not the prompt.
- Citations & groundingcorelabEvery claim points at the passage it came from, and answers say “not in the documents” when it isn’t.
- Keeping data freshcorelabThe index is a copy; copies go stale. Sync incrementally and know how stale you are.
- GraphRAGlabExtract entities and relations into a graph to answer multi-hop and “across the corpus” questions.
- Agentic RAGRetrieval as a tool the model calls, possibly several times, deciding what to search next.
- Evaluating retrieval and answerscorelabMeasure retrieval and generation separately, or you can’t tell which one broke.
- When not to use RAGIf it fits in context, changes every minute, or lives in a database, retrieval is the wrong tool.
- Text-to-SQLLet the model write queries against your database — read-only, schema-aware and checked.
- Multi-tenant indexesOne index per tenant, a shared index with tenant filters, or something in between.
Agents
The loop, tools, memory, multi-agent patterns, MCP, sandboxes, budgets and the ways agents fail.
- The agent loop (ReAct)corelabModel decides → calls a tool → reads the result → decides again, until done.
- Tool designcoreTools are an API for a model: few, clearly named, well described, hard to misuse.
- PlanningMake a plan first, then execute it step by step (and re-plan when reality differs).
- Reflection & self-correctionCritique your own output and try again — works best with an external signal.
- Agent memory typescoreWorking memory (the context), episodic (past runs), semantic (facts), procedural (how-to).
- Multi-agent patternscorelabOrchestrator-worker, supervisor, handoffs — and the question of whether you need more than one agent.
- HandoffsOne agent transfers the conversation to another specialist agent.
- Model Context Protocol (MCP)coreAn open standard for connecting models to tools, resources and prompts served by separate processes.
- A2A and AGENTS.mdAgent-to-agent communication (A2A) and repo instructions for coding agents (AGENTS.md).
- Browser & computer-use agentsAgents that operate a browser or desktop through screenshots, clicks and typing.
- Coding agentsAgents that read a repository, edit files, run commands and use tests as their feedback signal.
- SandboxingcorelabRun model-generated code and actions where a mistake can’t hurt anything.
- Stopping conditions & budgetscorelabEvery agent run needs limits: steps, tokens, money, time — and a defined way to stop.
- Human-in-the-loopcorePause for a person before irreversible, expensive or uncertain actions.
- Typical agent failure modescorelabLoops, wrong tools, hallucinated arguments, lost goals, injected instructions and runaway cost.
- Large toolsetsHundreds of tools don’t fit in context: search for tools, call in parallel, or let the model write code.
- Agent identity & delegated accessWho is the agent acting as, with which permissions, and how is that proven?
Agentic workflows
Fixed paths with LLM steps: the five canonical patterns, durable execution, retries, idempotency and checkpoints.
- Workflows vs agentscorelabWorkflow: code decides the path, LLMs fill in steps. Agent: the model decides the path.
- Prompt chainingcorelabBreak a task into fixed sequential LLM calls, with checks between them.
- RoutingcorelabClassify the input, then send it to a specialised prompt, model or pipeline.
- Parallelisation (sectioning & voting)corelabRun independent LLM calls at once: different subtasks (sectioning) or the same task several times (voting).
- Orchestrator-workerscorelabA central LLM decides the subtasks at run time and delegates them to workers.
- Evaluator-optimizercorelabOne call generates, another critiques against criteria, loop until it passes.
- Durable executioncorelabWorkflows that survive crashes, deploys and week-long waits by persisting every step.
- State machines, graphs & checkpointslabModel the flow as explicit states and transitions; save state after every step.
- Retries & idempotencycorelabRetry transient failures with backoff — and make sure retrying can’t do things twice.
- Long-running jobsWork that takes minutes to hours: accept, queue, report progress, notify when done.
- Sagas & compensating actionsMulti-step side effects without distributed transactions: each step has an undo.
- The framework landscapeLangGraph, Temporal, the vendor agent SDKs and the managed agent platforms — and when plain code is enough.
Guardrails & security
Prompt injection (direct and indirect), jailbreaks, PII, least privilege, exfiltration and the OWASP lists.
- Direct prompt injectioncorelabThe user types instructions that override yours: “ignore previous instructions and …”.
- Indirect prompt injectioncorelabInstructions hidden in content the model reads — web pages, emails, documents, tool results.
- JailbreakslabTricks that get a model to produce content its safety training should refuse.
- PII handlingcorelabFind, minimise, mask and control personal data before it reaches models, logs and caches.
- ModerationClassify inputs and outputs against your content policy.
- Tool permissions & least privilegecorelabGive the agent the narrowest tools and credentials that do the job — and check every call.
- Output validationcorelabTreat model output as untrusted input to the rest of your system.
- Data exfiltrationcorelabGetting private data out through the model: links, images, tool calls, emails.
- OWASP Top 10 for LLM applications (2025)corelabThe standard checklist: injection, disclosure, supply chain, poisoning, output handling, agency, prompt leakage, vectors, misinformation, unbounded consumption.
- OWASP Top 10 for Agentic ApplicationscorelabPublished December 2025: the risks specific to agents that plan, use tools and remember.
- The lethal trifecta & the Rule of TwocorelabPrivate data + untrusted content + a way to communicate out = exfiltration waiting to happen.
- Injection-resistant design patternslabArchitectures that limit what injected text can do: quarantined readers, plan-then-execute, action selectors.
- MCP & tool supply-chain securitylabTool descriptions are prompts; tool servers are dependencies; both can be malicious.
- Red teaminglabAttack your own system on purpose, systematically, before someone else does.
- Unbounded consumption (denial of wallet)Attackers — or bugs — making you pay for huge or endless model usage.
- Audit logs for AI actionsWho asked, which agent acted, what it did, with which data — reconstructable later.
- Data retention & residencyWhere prompts and outputs are processed and stored, for how long, and who can see them.
Evals & observability
Error analysis, golden sets, judges and their biases, statistics, tracing, online metrics and feedback loops.
- Error analysiscorelabRead real traces, name the failure patterns, count them — then build evals for the biggest ones.
- Golden datasetscorelabA curated, versioned set of inputs with expected outputs or criteria you run every change against.
- Code-based checkscorelabDeterministic assertions: valid JSON, right tool, cited IDs exist, required facts present.
- LLM-as-judge and its biasescorelabUse a model to grade outputs — after you’ve measured how much to trust it.
- Calibrating a judge against humanscorelabMeasure how often the judge agrees with expert labels before you let it gate releases.
- Regression tests & CI gatescorelabEvery prompt, model, chunking or tool change runs the eval suite and can be blocked.
- Statistics for evalslabConfidence intervals, run-to-run variance and sample sizes — so “v2 is better” means something.
- Synthetic test dataGenerate test inputs with an LLM along explicit dimensions — then filter with humans.
- Evaluating agentscorelabOutcome, trajectory and reliability: did it finish, did it take a sane path, does it do it every time?
- Online metrics & A/B testscorelabOffline evals predict; production metrics decide.
- Tracing model and tool callscoreOne trace per request: every LLM call, retrieval, tool call and decision, with inputs, outputs, tokens, cost and timing.
- Tracking cost and latencylabCost per request, per conversation, per tenant and per feature — next to quality.
- Feedback loopsTurn user signals and failures into better prompts, data and evals — continuously.
- OpenTelemetry GenAI conventionsStandard attribute names for LLM spans so traces work across tools.
- Drift & production monitoringInputs, models and data change under you; watch for it.
Backend engineering for AI
API design, streaming, async and concurrency, queues, caching, rate limits, Postgres + pgvector, multi-tenancy and testing.
- API design for AI featurescorelabSync, streaming or async job — pick by how long the work takes and who waits for it.
- Streaming over SSE vs WebSocketscorelabSSE for one-way token streams over plain HTTP; WebSockets when both sides talk continuously.
- Async & concurrencycorelabLLM apps mostly wait on the network — concurrency, not CPU, decides throughput.
- Python async specificslabThe event loop, the GIL, def vs async def in FastAPI, and free-threaded Python.
- Queues & workerscoreMove slow or bursty AI work off the request path; workers process at a controlled rate.
- Caching, including semantic cachingcoreExact caches for identical requests, semantic caches for similar ones — keyed per tenant.
- Rate limits & backoffcorelabProviders limit requests and tokens per minute; you limit your users. Both need graceful handling.
- Timeouts & cancellationcorelabEvery call has a deadline; when the user leaves, stop paying.
- Fallbacks across providerscoreWhen the primary model is down, slow or rate-limited, fail over to another — tested in advance.
- Postgres + pgvectorcorelabVectors in the same database as your data: joins, filters, transactions and row-level security for free.
- Database indexingcorelabB-tree for equality and ranges, GIN for full-text and JSON, HNSW/IVFFlat for vectors — and EXPLAIN to check.
- Transactions & isolation levelscorelabWhich anomalies each level allows — and why “check then write” needs a lock or SERIALIZABLE.
- Multi-tenancycorelabIsolate customers’ data, costs and limits across database, index, cache, logs and models.
- Auth & secretsAuthenticate users, authorise every action, and keep API keys out of code, prompts and logs.
- Idempotency keyscorelabA client-supplied key that makes retrying a POST safe.
- WebhooksPush notifications between systems: signed, retried, idempotent.
- Resumable streamslabIf the connection drops mid-answer, reconnect and continue instead of regenerating.
- Testing LLM applicationscorelabUnit tests with mocked models, contract tests for tools, property tests for parsers, evals for behaviour.
- DeploymentContainers or serverless, timeouts that fit LLM latency, environments and gradual rollouts.
Model choice & adaptation
Prompting vs RAG vs fine-tuning, LoRA, preference tuning, distillation, routing and cascades.
- Prompting vs RAG vs fine-tuningcorelabPrompting changes instructions, RAG changes knowledge, fine-tuning changes behaviour.
- Supervised fine-tuning (SFT)Train on input→ideal output pairs so the model imitates them.
- LoRAcorelabFine-tune by learning small low-rank matrices next to frozen weights.
- QLoRAlabLoRA on top of a 4-bit quantised base model — fine-tuning big models on one GPU.
- Preference tuning: RLHF and DPOlabTeach a model which of two answers is better, not just what one good answer looks like.
- Reinforcement fine-tuning with gradersRL on tasks with checkable answers, using a grader instead of human preferences.
- DistillationcorelabTrain a small, cheap model on a big model’s outputs for one task.
- Model routing & cascadescorelabSend each request to the cheapest model likely to handle it; escalate when unsure.
- Fine-tuning embedding modelsAdapt retrieval to your domain’s vocabulary with query–passage pairs.
- Open-weight vs closed modelsControl, privacy and cost at scale vs capability, convenience and zero ops.
- Model versions & deprecationsModels change and retire on the vendor’s schedule; pin versions and plan upgrades.
Serving, cost & performance
Hosted vs self-hosted, batching, quantisation, GPU memory, prefill vs decode and the cost of a request.
- Hosted APIs vs self-hostingcorelabPay per token with zero ops, or pay per GPU-hour and run the stack yourself.
- Serving engines (vLLM and friends)corelabSoftware that turns a model into a high-throughput API: batching, KV-cache management, kernels.
- Batching: static vs continuouscorelabServe many sequences per forward pass — and refill slots as soon as one finishes.
- PagedAttentionlabStore the KV cache in fixed-size blocks, like virtual memory pages.
- QuantisationcorelabStore weights (and sometimes activations or KV cache) in fewer bits: less memory, faster decode, some quality risk.
- GPU memory mathscorelabWeights + KV cache + activations must fit; whatever’s left decides how many users you can serve.
- Prefill vs decodecorelabPrefill reads the prompt in parallel (compute-bound); decode writes one token at a time (memory-bound).
- Throughput vs latencycorelabBigger batches serve more users per GPU but each user waits longer per token.
- Speculative decodinglabA small draft model guesses several tokens; the big model checks them in one pass.
- Prefix caching (self-hosted)labReuse KV cache across requests that share a prefix: system prompt, tools, few-shot examples.
- Tensor & pipeline parallelismSplit a model across GPUs when it doesn’t fit on one.
- Batch APIs & provisioned throughputlabDiscounted asynchronous processing for work that can wait; reserved capacity for work that can’t.
- LLM gatewaysOne internal endpoint for all models: routing, fallbacks, keys, budgets, caching and logs.
- GPU autoscaling & cold startsGPUs take minutes to add and models take time to load — scale ahead of demand.
- Cost per request & back-of-envelope mathscorelab(input tokens × input price + output tokens × output price) × calls per request — then multiply by traffic.
The FDE role
Discovery, scoping, fast POCs, integrating with customer systems, security reviews, success metrics and handoff.
- What a forward deployed engineer doescorelabAn engineer embedded with customers who turns a vague business problem into a working deployment.
- Discovery with a customercorelabFind the workflow, the pain, the baseline, the data and the decision-maker before proposing anything.
- Turning a vague ask into a scoped POCcorelabPick one slice with clear value, available data and a measurable success criterion — and say what’s out of scope.
- Success metrics for AI deploymentscorelabBusiness outcome, model quality and operational metrics — agreed before building.
- Integrating with customer systemscoreSSO, data connectors, existing workflows and the systems of record — where most of the time goes.
- Deployment models: SaaS, VPC, on-premcoreWhere the system runs decides what the security team will approve.
- Security reviewscorelabQuestionnaires, architecture reviews and pen tests — answered with data flows and controls.
- Compliance vocabularySOC 2, ISO 27001, GDPR, HIPAA, DPAs and the EU AI Act — what each means for your design.
- Demos & handofflabShow the agreed metric on the customer’s data, then leave something they can run without you.
- The ROI / value caseTranslate the system into money: time saved, errors avoided, revenue gained, minus what it costs.
- Adoption & change managementA working system nobody uses is a failed project.
- “It must be 100% accurate”labReframe from perfection to risk: compare with today’s error rate and design how errors are caught.
- The decomposition roundcorelabBreak a vague real-world problem into parts, with data and users in mind, while the interviewer pushes back.
- The learning roundlabPick up an unfamiliar library or codebase fast and extend it in stages.
- The re-engineering (debugging) roundlabGiven broken code and its intended behaviour, find and fix the problem systematically.
Interview formats
What each round looks like and what it is really testing.
- The AI system design roundcorelabDesign an LLM-powered system end to end — and show how you’d know it works.
- Coding rounds for AI rolescorelabPractical builds: an agent loop, a RAG pipeline, a chunker, BM25, retries, a streaming parser.
- The take-homecorelabBuild a small LLM system and measure it: e.g. 50 docs → Q&A + a 20-question eval set + recall@5 and faithfulness.
- Live debugging roundslab“This agent loops forever on some inputs. Find out why and fix it.”
- Customer-conversation simulationlab“The bot feels dumb. What do you change first?” — turn a vague complaint into a plan.
- Eval design questionscorelab“How do you know it’s helping and not making things worse?”
- The tech-screen classiclab“You have a 200-page PDF and a question. What happens between Enter and the answer?”
- Project deep divescorelabWalk through something you built: problem, baseline, design, metrics, what failed, what you’d change.
- Behavioural rounds for AI roleslabAmbiguity, shipping under uncertainty, saying no to customers, owning a model failure.
- AI-assisted coding roundsSome loops now allow (and assess) using an AI coding assistant during the interview.
Voice & realtime agents
STT → model → TTS, turn-taking, interruptions and the latency budget.
- The voice agent pipelinecorelabSpeech-to-text → model → text-to-speech, streamed end to end.
- Voice activity detection & turn-takingKnowing when the user has finished speaking — the hardest small problem in voice.
- Interruptions (barge-in)The user talks while the agent is speaking: stop, listen, and remember what was actually said.
- The voice latency budgetcorelabAim for roughly 800 ms or less from end of speech to first audio.
- Speech-to-speech models vs cascadesOne model hears and speaks directly — lower latency and better prosody, less control.
- Telephony & WebRTCHow audio actually reaches the agent: phone networks (SIP) or browsers and apps (WebRTC).
Use-case blueprints
The enterprise patterns design and FDE rounds keep returning to, with their traps and metrics.
- Blueprint: customer support agentcorelabGrounded answers, account tools behind permissions, refunds with limits, and a clean human handoff.
- Blueprint: enterprise search over permissioned docscorelabConnectors with ACL sync, hybrid retrieval, permission filters from SSO, citations.
- Blueprint: document processing pipelinecorelabIngest → classify → parse → extract to schema → validate → human review for low confidence → system of record.
- Blueprint: analytics / text-to-SQL agentQuestions in plain language, answers from the warehouse — read-only and explainable.
- Blueprint: classification & routing at volumeLabel millions of items cheaply: small model or fine-tune, confidence thresholds, human audit.
- Blueprint: summarisation & meeting notesLong inputs, structured outputs, factual consistency.
- Blueprint: coding assistantlabRepo-aware context, sandboxed execution, tests as the verifier, diffs for review.
- Blueprint: deep research agentlabOrchestrator plans, parallel subagents search, a synthesiser writes a cited report.
AI product sense
Designing for uncertainty, latency perception, feedback, handoff and unit economics.
- Designing for uncertaintyShow sources, signal confidence, make “I don’t know” acceptable and corrections easy.
- Latency perceptionStreaming, progress and partial results make 5 seconds feel like 1.
- Feedback captureMake it effortless to say “this was wrong” — and capture why.
- Human handoffWhen the AI can’t help, get the user to a person — with context, quickly.
- Unit economics of AI featureslabCost per task vs value per task, at the volume you expect.
- When not to use an LLMDeterministic rules, search, forms or classic ML are often better, cheaper and more reliable.
ML basics that still come up
Precision and recall, calibration, leakage and baselines — mostly because evals and classifiers are judged with them.
- Precision, recall & F1corelabOf what you flagged, how much was right (precision); of what was there, how much you found (recall).
- ROC vs precision-recall curvesROC-AUC flatters on imbalanced data; PR curves show what you’ll actually get.
- CalibrationWhen the model says 80%, is it right about 80% of the time?
- Leakage & data splitsIf test data leaks into training — or few-shot examples — your scores lie.
- Class imbalanceWhen the interesting class is rare, sample, weight and measure accordingly.
- BaselinesAlways compare with the simple thing: rules, BM25, logistic regression, the current human process.
X vs Y
The real difference in one line, then when to pick each.
- RAG vs fine-tuningRAG changes what the model can look up; fine-tuning changes how it behaves.
- Long context vs RAGLong context sends everything every time; RAG sends the right part.
- BM25 vs dense retrievalBM25 matches the words; dense retrieval matches the meaning.
- HNSW vs IVFHNSW walks a graph (fast, high recall, memory-hungry); IVF probes a few clusters (lighter, recall depends on nprobe).
- Bi-encoder vs cross-encoderA bi-encoder embeds query and document separately; a cross-encoder reads them together.
- Workflow vs agentIn a workflow your code picks the next step; in an agent the model does.
- Single agent vs multi-agentMulti-agent buys parallelism and clean contexts with many more tokens and coordination risk.
- MCP vs function callingFunction calling is how a model asks for a tool; MCP is how tools are packaged and discovered across apps.
- MCP vs A2AMCP connects an agent to tools and data; A2A connects an agent to another agent.
- SSE vs WebSocketsSSE is one-way streaming over plain HTTP; WebSockets are two-way and stateful.
- Prompt caching vs semantic cachingPrompt caching makes the call cheaper; semantic caching skips the call.
- pgvector vs a dedicated vector databasepgvector keeps vectors next to your relational data; dedicated stores specialise in vector search at scale.
- LoRA vs full fine-tuningLoRA trains a tiny set of adapter weights; full fine-tuning updates everything.
- Preference tuning vs reinforcement fine-tuningPreference tuning learns from “A is better than B”; RFT learns from a grader’s score.
- Hosted API vs self-hosted vLLMHosted is pay-per-token with no ops; self-hosted is pay-per-GPU-hour with full control.
- Static vs continuous batchingStatic batches wait for the slowest sequence; continuous batching refills free slots every step.
- Pre-filtering vs post-filteringPre-filtering searches only allowed documents; post-filtering searches everything and drops what’s not allowed.
- LLM judge vs code checksCode checks are exact and cheap but narrow; judges handle open-ended quality but need calibration.
- Offline evals vs online metricsOffline evals predict quality before release; online metrics measure it on real users.
- Cascade vs always using a reasoning modelA cascade pays for reasoning only on the hard fraction of traffic.
- Cascaded voice vs speech-to-speechCascades give control and transcripts; speech-to-speech gives lower latency and more natural speech.
- Architectural defences vs injection classifiersClassifiers lower the odds of an attack working; architecture limits what a successful attack can do.