Walkthroughs
Worked answers to reported Senior and Staff interview questions: scoping, the math, the design, failure modes, how Senior and Staff answers differ, and a lab that proves it.
Researched
Each walkthrough covers one family of questions from the question bank: one underlying problem that companies ask in different words. It follows a fixed skeleton, so you can practise the structure as well as the content, and it has a small-team version: what one engineer owning AI at a 50–500 person company would build, buy or skip. Every question also gets a short answer card on its own page that links back to its family. Numbers come from formulas or from lab measurements that say where they were measured.
278 of 278 questions have a published answer card.
AI Engineer
16 families · 86 of 86 questions answered
Know whether an LLM feature is good: error analysis, eval sets, release gates, production metrics
Decide whether an AI assistant is good enough to ship or expand: turn complaints into failures you can count, grade with code, a checked AI grader and people, compare versions on the same test cases, then roll out slowly.
Design a RAG system end to end and justify every knob
Answer questions over private documents, with sources: when to skip retrieval, how to parse and chunk, hybrid search, reranking, choosing how many passages to send, citations and refusals, and how to measure each choice.
Agent or workflow? Designing multi-step LLM automation
Automate an internal process with LLMs: put each step in plain code, one model call or a capped agent loop, check what the model produces, run it so it survives restarts, and add more agents only when it pays.
Build an LLM app or agent take-home, then defend it
Scope a 2–5 hour LLM app or agent build, ship a working core with checked model output, a human approval step before any write and a small labelled test set, then explain every choice. Includes a runnable Python loop.
Build a small RAG or semantic search in code, then measure it
Write the parts of a small RAG system yourself (chunking, vector search, keyword search, merging the two, a cited answer), then prove it works on a labeled question set and say what changes at 100× the data.
Customer-facing support agent: tool loop, hand-off and stop conditions
Design a support agent that, on every turn, answers, calls a tool or hands off to a person, and never loops: stop conditions, tool permissions, state, voice, debugging, metrics, and when to buy one instead.
Permission-aware enterprise RAG and search
An assistant over a company's Drive, Slack, email and wikis that never shows anyone a passage they can't open: where the permission check runs, how long a revoked document stays citable, outages, and safe caching.
LLM-as-judge and human labels: when to trust automated grading
How to check an LLM that grades other LLM outputs: compare it with human labels, report how many failures it catches, correct agreement for chance, test its biases, and handle outputs people judge by taste.
Agent memory and context management
Keep a long-running agent inside its context window and help it remember across sessions: compaction that keeps promises and tool results, long-term memory with a write and a read path, expiry, and reusable skills.
Prompting, RAG or fine-tuning: choose from the failure, prove the return
How to choose between a better prompt, retrieval and fine-tuning, how to tell whether a fine-tune pays for itself, and how to explain the model internals a depth round asks about, in plain words.
Agent tool permissions and trust boundaries
Give an agent tools over billing, internal data or a codebase, and show that injected text can't trigger a privileged write or leak data: identity from the session, scoped tools, approval gates, egress control, honest limits.
Code a concurrent LLM API client: retries, 429s, pagination, batching and streaming
A practical coding round reported at Sierra, PromptLayer and Cursor: build an async client that sends many calls at once, retries the right failures, obeys rate limits, pages, batches and parses a stream.
Customer discovery and scoping before architecture
A customer, executive or broken system arrives with a vague AI ask. Ask questions before you design, turn the answers into a small first project with a number for success, handle the skeptic, and debug by asking for evidence.
Guardrails for LLM apps that read untrusted content
Summarize hostile reviews, answer users safely, or refuse requests for personal data. What runs before, around and after the model, which checks are guarantees and which are only signals, and how to measure each one.
Measure retrieval and debug confident wrong answers
Find the stage that produced a confident wrong answer: trace it, sort failures by stage, give retrieval a number on a labeled query set, check answers against their sources, and prove each fix. High-risk answers add abstention and review.
Design an AI coding assistant: repository context, edit application, latency
Pick which code the model sees under a size budget, apply its suggested change without breaking the file, keep suggestions fast, and keep customer code private. Plus what a small team buys instead.
AI Infra
17 families · 94 of 94 questions answered
From one GPU batcher to a fleet
Group waiting callers into batches for one GPU, send each answer back to the right caller, survive a GPU dying mid-batch, then size a 100,000-requests-per-second fleet with simple arithmetic before drawing it.
KV cache and GPU memory math: sizing, paging and OOMs
How much GPU memory a self-hosted LLM needs and how many users it serves: weights, the per-token KV cache, TP=2 vs TP=4 for a 70B model, paged blocks, and a pod OOMKilled on an 80 GB GPU.
Roofline and sharded-matmul math
Count FLOPs, bytes and link traffic for a matmul, find the ridge point, explain why decode is memory-bound and prefill compute-bound, and shard on M, N or K (an FFN, an LM head, two GPUs) with the right collective.
Move big bytes fast: weight distribution, cold starts and bulk transfer
Get a huge model file to every GPU machine, or start one GPU container fast, or move 200 TB once: work out the times from bandwidth first, then design chunked delivery, safe rollout and instant rollback.
Distributed training: parallelism plan, collectives, checkpointing and recovery
Plan a large training run across hundreds of GPUs: split the model so it fits, keep heavy traffic on fast links, see why 4× the GPUs is not 4× faster, and checkpoint so one dead machine costs minutes, not hours.
Concurrent I/O workers: crawler, thread pool, file pipelines, chunked download
Write a crawler, make it concurrent without losing pages or hanging at the end, then reuse the same shape for duplicate files, an image pipeline, a thread pool and a parallel chunked download. Built in stages, run and timed.
Async GPU job system: queueing, leases, fencing and no lost work
Design a job queue for long GPU tasks such as text-to-video: accept a job so it is never lost, share GPUs fairly with a paid tier, re-run crashed work safely, contain a model that breaks on some GPU types, and survive bursts.
Key-value store to durable log: transactions, snapshots, WAL and group commit
Build a key-value store, add nested transactions, save it to a file, make it survive a crash with a write-ahead log, then let many threads share one log with group commit. Code in stages, with crash tests.
GPU kernel performance: coalescing, tiling, fusion, FlashAttention, CUDA graphs
Why a GPU program runs at 15% of its memory speed, how to write a safe softmax, why FlashAttention is faster, and when CUDA graphs help. Measure first, count bytes, and match each fix to what the profiler shows.
Run many models for many tenants on a shared GPU fleet
Keep about 200 open models and many tenants' small add-on adapters on shared GPUs: which models stay loaded, how 8-GPU and 1-GPU models fit together, how tenants avoid starving each other, and when a customer gets their own GPUs.
Quantization, speculative decoding and MoE as measurable trade-offs
Three ways to serve a model cheaper or faster: fewer bits per number, a small model that guesses ahead, and a model that uses only part of itself per word. For each, say what it saves, what it costs and how you'd measure it.
Rate limits, credits and admission control for an LLM API
Limits for an LLM API in plain words: count tokens as well as requests, apply every rule in one atomic step, keep GPU credits as a ledger, and decide what to accept, queue or reject when the GPUs are full.
Diagnose slow or stuck infrastructure: Linux, Kubernetes, data pipelines
How to handle 'it's slow' and 'it's stuck' rounds: define slow, check how busy and how queued each resource is, run the one command that rules a guess out, then stabilize, fix and prove it. Eight worked cases.
Critique a batch-inference design doc
You are handed a half-built design for running a model on GPUs in batches. Walk one request through it, check its math, find where it breaks under load or failure, rank the fixes, and say them like a good reviewer.
GPU cluster control plane: placement, topology, health and drain
Design the brain of a shared GPU cluster: track which machines are alive, hand out jobs safely, place GPU work so big jobs still fit, keep multi-machine jobs close together, and pull out and return bad GPUs.
Systems-level concurrency primitives and race hunting
Four short systems questions: memmove and an alignment macro, a bounded queue many threads share, a thread-safe reference-counted pointer, and a race that only shows up under load. C++ and Go code, run under sanitizers.
Continuous batching: write the decode-loop scheduler
Write the loop that runs many text-generation requests through one model call per step, refills a slot the moment a request finishes, stays inside GPU memory and stops on disconnect; then explain why long prompts slow everyone down.
Both tracks
16 families · 98 of 98 questions answered
AI-assisted coding round in a provided codebase
Meta-style rounds (and their Microsoft, OpenAI, Apple and Fireworks cousins): fix a bug, build a feature and make it faster in a repo you've never seen, with an AI assistant you direct, check and sometimes overrule.
Implement LLM internals from scratch: attention, KV cache, GQA, decoding and BPE
The coding round, often with no AI tools, where you build a language model's parts by hand: attention, a cache for fast generation, decoding and a tokenizer, each tested against a trusted reference.
Multi-part practical coding: a credit ledger whose requirements keep changing
Long practical problems (credit ledgers, spreadsheets, task managers, profilers, schedulers) where a new requirement lands every few minutes. Get a correct core fast, keep the next change small, and prove each stage with a test.
Caches in coding rounds: LRU and LFU, TTL, threads, snapshots and coalesced chunk fetches
Build an LRU cache, then add expiry, threads, save and restore, LFU, and a cache of 200 MB remote chunks that many callers miss at once. Get the core right fast, then reason about time, locks and bytes.
Present an AI project you built: ownership, trade-offs and numbers
Present an AI system you built in 30 to 45 minutes and survive the questions: why an LLM, what you owned, the option you rejected, the quality number, what broke, the timeline, the cost and how it scales.
Drive a coding agent through a product-shaped build
Agent-assisted rounds at Stripe, Canva, Shopify, Snowflake, OpenAI and Cursor: you own the plan and the tests, the agent types, and you stop a growing spec from quietly changing what earlier rules mean.
Drive decisions and own the outcome: buy-in, pushback, being wrong
Stories about a decision you drove, a peer you persuaded, an executive you told no, customer pain you turned into product, a failure you owned and a time you were wrong. Lead with the decision, show your part and the trade-off, then stop.
Make an LLM feature fast and affordable: latency budgets, token cost, caching, model choice
Split the wait into stages you can measure, price every request in tokens, then pull the cheap levers first: shorter prompts, prompt caching, batch APIs, a cheaper model where the eval allows. Self-host only with the GPU math.
Internal LLM platform: provider gateway, routing, budgets and prompt versions
Design the shared layer every service uses to call models: failover between providers, limits and budgets counted in tokens, a cost record per call, a safe result cache, routing by tier and prompts kept as fixed versions.
Serve a ChatGPT-style assistant with streaming
Design ChatGPT-style serving: stream each reply, budget the wait for the first word and the gap between words separately, limit free users by tokens, share the common prompt, and survive disconnects and spikes.
Read, explain and fix code you didn't write: a URL shortener with six bugs
You get a small codebase you didn't write, often AI-generated, and must explain it, find the bugs and fix them in one round. Show a method: run it, map it, rank suspicions, failing test, smallest fix, explain.
Your view of AI: how you use it, why this role, what you would critique
How you use AI at work, how you compare assistants, the wrong AI output you caught, why you want this role, and what you'd critique about the company. Strong answers are specific, checked and candid.
Make the business case: ROI, build versus buy, scarce compute
Defend what a project cost and what it returned: the '$20M, was it worth it?' question, sharing scarce compute, conflicting feature requests, and build versus buy, answered with simple arithmetic and labelled assumptions.
Values and safety judgment: moral conflict, delivery pressure, release calls
Personal stories about a moral conflict or a safety concern under deadline, and judgment questions on releasing a model or shipping AI to consumers. Strong answers are honest and reflective, and name a release gate you would hold.
Short DSA screens with an infrastructure flavor: idle GPUs, padding, scheduling, cycles
Classic algorithm problems dressed in infrastructure words: idle GPUs, padding uneven arrays, scheduling jobs, finding loops. Name the pattern, ask the one question that changes the algorithm, and test against a brute force.
System design with an AI assistant in the room
A normal design round with an AI chat open beside you. Set the requirements and numbers yourself, use the assistant to draft and check, and correct its confident mistakes out loud.