Generative AI
One place to master Generative AI — a structured, ten-level roadmap from AI foundations and working with LLMs, through RAG, vector databases, and agents, into AI system design (ChatGPT, coding assistants, answer engines), production AI, and advanced topics, and finishing with interview preparation and hands-on projects. Every lesson is a full deep dive: theory, interactive diagrams, request flow, production considerations, an interview perspective, and hands-on examples.
101
Lessons
23
Available now
10
Roadmap levels
10+
Companies
Level 1 · AI Foundations
The mental models every AI interview assumes you already have — transformers, attention, tokenization, inference, and decoding.
Transformer Architecture
How the transformer block works end-to-end — embeddings, self-attention, feed-forward layers, and residual streams.
Attention Mechanism
Scaled dot-product and multi-head attention — the intuition, the math, and why it scales to long context.
Tokenization & Embeddings
BPE, subword vocabularies, and how tokens become vectors — the input side of every LLM.
How LLM Inference Works
Prefill vs decode, the KV cache, and why the first token is slow but the rest are fast.
Sampling & Decoding Strategies
Temperature, top-k, top-p, and beam search — how token probabilities become text, and when to use each.
Context Windows & KV Cache
Why context is expensive, how the KV cache grows, and the tricks that push context from 4K to 1M tokens.
Hallucinations & LLM Limitations
Why LLMs make things up, how to measure it, and the system-level mitigations interviewers expect you to know.
Prompt Engineering Foundations
System vs user prompts, few-shot, chain-of-thought, and structured output — the reliable building blocks.
Choosing the Right Model
Open vs closed, size vs latency vs cost, and how to pick a model (or a cascade) for a given workload.
Level 2 · Working with LLMs
Building on model APIs day to day — provider SDKs, structured outputs, JSON mode, streaming, function/tool calling, prompt templates, and guardrails.
Calling the OpenAI API
The Chat Completions and Responses APIs end-to-end — messages, roles, parameters, token accounting, and error handling.
Calling the Anthropic (Claude) API
Claude's Messages API — system prompts, content blocks, stop reasons, and prompt-caching for cheaper long context.
Calling the Google Gemini API
Gemini's generateContent API — multimodal inputs, safety settings, and grounding with Google Search.
Azure OpenAI Service
Running OpenAI models on Azure — deployments, regional data residency, private networking, and enterprise auth.
Structured Outputs
Guaranteeing schema-valid responses — JSON Schema, response formats, and refusal handling for reliable pipelines.
JSON Mode
Forcing valid JSON from any model — when to use JSON mode vs structured outputs, and how to recover from partial output.
Streaming Responses
Server-sent events and token streaming — delta parsing, backpressure, cancellation, and rendering partial tokens in the UI.
Function & Tool Calling
Letting the model call your code — tool schemas, argument validation, parallel tool calls, and the tool-result loop.
Model Context Protocol (MCP)
The open standard for connecting models to tools and data — servers, resources, tools, and transport, and why it matters.
Prompt Templates & Chaining
Reusable, versioned prompts and multi-step chains — variables, few-shot templates, and composing calls into workflows.
Output Guardrails & Validation
Keeping model output safe and correct — content filters, schema validation, retries, and fallbacks before you trust a response.
Level 3 · Retrieval-Augmented Generation
Grounding LLMs in your own data — chunking, hybrid retrieval, reranking, evaluation, and cost control.
Design a Production RAG System
Design an end-to-end retrieval-augmented generation system — ingestion, chunking, embedding, hybrid retrieval, reranking, and grounded generation at scale.
Document Chunking Strategies
Fixed, recursive, semantic, and structure-aware chunking — how splitting decisions make or break retrieval quality.
Hybrid Search for RAG
Combine BM25 keyword search with dense vectors and fuse the results — the retrieval backbone of strong RAG.
Reranking in RAG Pipelines
Cross-encoder rerankers — why a second stage dramatically lifts precision, and how to keep it cheap.
Evaluating RAG Quality
Retrieval and generation metrics — recall@k, faithfulness, answer relevance, and LLM-as-judge pipelines.
Multimodal RAG
Retrieve over text, tables, and images — unified embeddings, layout parsing, and grounded multimodal answers.
Agentic RAG
Let the model decide when and what to retrieve — query planning, multi-hop retrieval, and self-correction.
Cost & Caching for RAG
Semantic caching, embedding reuse, and context trimming — how to cut RAG bills without hurting quality.
Level 4 · Vector Databases & Search
The retrieval substrate behind RAG — embeddings, ANN indexes (HNSW, IVF-PQ), sharding, and filtered search at billion scale.
Design a Vector Database
Design a vector database that indexes billions of embeddings for millisecond similarity search — ANN indexing, sharding, filtering, and persistence.
Approximate Nearest Neighbor Algorithms
The ANN landscape — trees, LSH, graphs, and quantization — and the recall/latency/memory tradeoffs between them.
HNSW Index Deep Dive
Hierarchical navigable small worlds — how the graph is built and searched, and how to tune ef and M.
IVF & Product Quantization
Inverted-file indexing and PQ compression — the technique that makes billion-vector search fit in RAM.
Storing Billions of Embeddings
Memory vs disk (DiskANN), tiered storage, and the cost model behind large-scale vector storage.
Sharding & Replication for Vector DBs
Partition billions of vectors across nodes, replicate for availability, and scatter-gather queries with low tail latency.
Filtered Vector Search
Combine metadata predicates with similarity — pre-, post-, and single-stage filtering, and why it is surprisingly hard.
Choosing an Embedding Model
Dimensionality, domain fit, MTEB benchmarks, and cost — how to pick and evaluate an embedding model.
Level 5 · AI Agents & Orchestration
Systems that plan and act — tool calling, memory, guardrails, and multi-agent orchestration.
Design an AI Agent
Design a single tool-using agent — the reasoning loop, tool schema, memory, and error recovery.
Tool Calling & Function Calling
How models call functions — schema design, argument validation, parallel calls, and safe execution.
Agent Memory Systems
Short-term, long-term, and episodic memory — summarization, vector recall, and context management for agents.
ReAct & Planning Loops
Reason-act-observe loops, plan-and-execute, and reflection — the control structures behind capable agents.
Design an Autonomous Task Agent
Design a long-running agent that decomposes goals, runs tools, and checkpoints progress with human approval gates.
Agent Guardrails & Safety
Sandboxing tools, permission scopes, and output validation — keeping autonomous agents from doing damage.
Design a Multi-Agent System
Design an orchestrator-worker multi-agent system — role decomposition, shared state, and conflict resolution.
Design a Web-Browsing Agent
Design an agent that navigates real web pages — DOM grounding, action space, safety, and rate limiting.
Level 6 · AI System Design
End-to-end product systems built on top of LLMs — ChatGPT, coding assistants, answer engines, content moderation, and streaming UX.
Design ChatGPT
Design a multi-turn conversational AI product — streaming responses, conversation memory, moderation, and scale to millions of users.
Design an AI Coding Assistant
Design a Copilot-style assistant — repo context, fill-in-the-middle completion, low latency, and privacy.
Design an AI Customer Support System
Design an LLM support agent grounded in help-center docs with escalation, tools, and deflection metrics.
Design an AI Writing Assistant
Design a Grammarly/Notion-AI-style assistant — inline suggestions, tone control, and multi-tenant data isolation.
Design a Multi-User LLM Chat Platform
Design the backend for a team chat product with shared threads, per-user quotas, and provider fallback.
Design an AI Answer Engine
Design a Perplexity-style answer engine — live web retrieval, citation grounding, and streamed synthesis.
Design an LLM Content Moderation System
Design a real-time safety classifier pipeline — policy taxonomy, latency budget, and human review loop.
Design Streaming Token Delivery
Design the transport for token-by-token responses — SSE vs WebSockets, backpressure, and cancellation.
Level 7 · Production AI
Running AI in production — model serving, KV cache, batching, quantization, observability, evaluation, semantic caching, and cost optimization.
Design an LLM Inference Service
Design a high-throughput inference service — request queue, batching, KV cache, GPU pooling, and autoscaling.
KV Cache Optimization
PagedAttention, cache eviction, and prefix sharing — the memory tricks that multiply inference throughput.
Continuous Batching
Iteration-level scheduling that keeps GPUs saturated — why it beats static batching for LLM serving.
Speculative Decoding
Draft-and-verify decoding — use a small model to propose tokens a big model checks, cutting latency.
GPU Scheduling & Autoscaling
Bin-packing GPUs, cold-start mitigation, and scaling on queue depth — the ops side of inference at scale.
Quantization for Inference
INT8, FP8, and 4-bit weights — how quantization shrinks models and the accuracy tradeoffs to defend.
Multi-Model & LoRA Serving
Serve hundreds of fine-tuned adapters from one base model — LoRA swapping, routing, and memory sharing.
Design an LLM Gateway
Design a unified gateway across providers — routing, rate limits, key management, caching, and fallbacks.
Design LLM Observability
Design tracing for LLM apps — spans across retrieval and generation, token/cost metrics, and quality signals.
Design an LLM Evaluation Platform
Design an offline+online eval platform — golden sets, LLM-as-judge, human review, and regression gates.
A/B Testing LLM Features
Experiment on prompts and models — metrics, guardrail metrics, and why LLM experiments are noisy.
LLM Cost Optimization
Model cascades, caching, batching, and prompt compression — a systematic playbook for cutting inference cost.
Design a Prompt Management System
Design versioned prompt storage — templates, variables, staged rollout, and rollback tied to evals.
Design a Semantic Cache
Design an embedding-based cache for LLM responses — similarity thresholds, staleness, and correctness risks.
Model Monitoring & Drift Detection
Detect data and quality drift in production — distribution monitors, canaries, and automated rollback.
Design an LLMOps CI/CD Pipeline
Design CI/CD for prompts, models, and RAG indexes — eval gates, staged rollout, and automated rollback.
Level 8 · Advanced AI
The platforms and hard problems behind the models — distributed training, fine-tuning, RLHF, feature stores, safety, security, and governance.
Design a Distributed Training Platform
Design a platform to train large models — job scheduling, data/model/pipeline parallelism, and checkpointing.
Design an LLM Data Pipeline
Design a pretraining/fine-tuning data pipeline — crawling, dedup, filtering, tokenization, and lineage.
Distributed Training Strategies
Data, tensor, pipeline, and FSDP parallelism — how huge models are split across thousands of GPUs.
Design a Feature Store
Design online/offline feature storage — consistency, point-in-time correctness, and low-latency serving.
Experiment Tracking & Model Registry
Track runs, version datasets and models, and gate promotions — the reproducibility backbone of ML.
Design a Fine-Tuning Pipeline
Design a pipeline for supervised fine-tuning and LoRA — data curation, training, eval gates, and rollout.
Design an RLHF Pipeline
Design reinforcement learning from human feedback — preference data, reward modeling, and PPO/DPO training.
GPU Cluster Management
Fair-share scheduling, gang scheduling, and fault recovery for large GPU clusters running mixed workloads.
Defending Against Prompt Injection
Direct and indirect prompt injection — the threat model, and layered defenses interviewers want to hear.
Design an LLM Guardrail System
Design input/output guardrails — policy checks, schema validation, PII filters, and safe-completion routing.
PII Detection & Redaction
Detect and redact sensitive data before it reaches a model — classifiers, tokenization, and reversible masking.
Hallucination Mitigation
System-level mitigations — grounding, citations, self-consistency, and abstention — with measurable guarantees.
Design an AI Content Safety Pipeline
Design a safety pipeline for generated text and images — classifiers, thresholds, appeals, and audit trails.
Model Access Control & Rate Limiting
Per-tenant quotas, token budgets, and abuse detection — protecting expensive model endpoints.
AI Governance & Audit Logging
Model cards, data lineage, approval workflows, and immutable audit logs — the compliance layer for AI.
Jailbreak Detection
Detect adversarial prompts that bypass safety — classifiers, canaries, and red-teaming feedback loops.
Level 9 · Interview Preparation
Full mock-interview problems that combine everything — recommendations, image generation, voice, translation, and more.
Design AI-Powered Recommendations
Design a recommendation system with embeddings and LLM re-ranking — candidate generation, ranking, and freshness.
Design an Image Generation Service
Design a text-to-image service — diffusion inference, GPU queueing, safety filters, and asset storage.
Design a Voice Assistant
Design a real-time voice assistant — streaming ASR, LLM reasoning, TTS, and end-to-end latency budgets.
Design an AI Code Review System
Design an AI reviewer for pull requests — repo context, diff analysis, false-positive control, and CI integration.
Design an AI Fraud Detection System
Design a hybrid ML + LLM fraud system — features, real-time scoring, explanations, and analyst tooling.
Design an AI Meeting Notetaker
Design a meeting assistant — diarized transcription, summarization, action items, and searchable history.
Design Real-Time AI Translation
Design streaming speech-to-speech translation — incremental decoding, latency, and quality/latency tradeoffs.
Design an AI Tutor
Design a personalized tutoring system — knowledge modeling, adaptive prompts, grounding, and safety for minors.
Design an LLM Personalization Engine
Design a system that personalizes LLM outputs per user — profile memory, retrieval, and privacy controls.
Level 10 · Hands-On Projects
Capstone builds that turn the roadmap into portfolio projects — build ChatGPT, a coding copilot, a RAG system, an agent, and an AI search engine.
Build ChatGPT from Scratch
A capstone build of a streaming chat app — conversation state, streaming responses, message history, and persistence.
Build an AI Coding Copilot
A capstone build of an inline code assistant — repo context, fill-in-the-middle, tool calling, and diff application.
Build a RAG System
A capstone build of an end-to-end RAG app — ingestion, chunking, embeddings, a vector store, retrieval, and grounded answers.
Build an AI Agent
A capstone build of a tool-using agent — planning loop, tool execution, memory, and guardrails against runaway loops.
Build an AI Coding Assistant
A capstone build of a chat-based coding assistant — codebase indexing, retrieval over source, and multi-file edits.
Build an AI Search Engine
A capstone build of an answer engine — query understanding, retrieval, reranking, cited synthesis, and follow-ups.
Build an AI Workflow Platform
A capstone build of a node-based workflow runner — chaining prompts and tools, branching, retries, and observability.
Build a Document Chat App
A capstone build of chat-with-your-PDF — upload, parsing, chunking, retrieval, and grounded answers with citations.