TechSchool
Home / Interview questions / AI engineering / AI System Design

AI System Design Interview Questions

Short answers to 10 ai system design interview questions.

Questions and answers (10)

Answers are written in plain English and reviewed for technical accuracy. Each answer states the point first, then the reason.

1. Design an enterprise RAG assistant over 10M documents with per-user permissions.

Use a two-stage retrieval design with permission filters applied before search. Store each chunk with a document ID and an access control list. Filter the candidate set by user group at query time, then run vector search on the allowed subset. A common target is 50 to 100 retrieved chunks before reranking.

2. Design a code assistant: repo indexing, context assembly, edit application, evaluation.

Index the repo by chunking files on function boundaries and storing symbol metadata. Assemble context from the current file, related symbols, and recent edits. Apply edits as structured patches and verify them with tests. Measure quality with a pass rate on a held-out task set.

3. Design a customer-support agent that can take real actions, with escalation to humans.

Give the agent a small set of typed tools with strict input schemas. Require confirmation for high-risk actions such as refunds above a set amount. Escalate to a human when confidence is low or the user asks for a person. Log every action with the tool name and arguments for audit.

4. Design semantic search over a large product catalogue.

Use a hybrid search design that combines dense vectors with keyword matching. Embed the product title and key attributes, and keep filters for category, price, and stock. Rerank the top 100 results with a cross-encoder. This two-stage design keeps latency low at catalogue scale.

5. Design a content-moderation system combining classifiers and LLMs.

Run a fast classifier on all content and send only uncertain cases to an LLM. Set two thresholds to create a clear allow band and a clear block band. Route the middle band to the LLM with a policy prompt. This design cuts LLM cost while keeping recall high.

6. Design a document-intelligence pipeline: scanned PDFs in, structured fields out, at 10M documents.

Split the pipeline into OCR, layout parsing, field extraction, and validation stages. Run OCR in parallel batches and store page images and text in object storage. Use a small model for common layouts and an LLM for hard cases. At 10M documents, throughput and retry handling matter more than model size.

7. Design a Text-to-SQL system over a warehouse with thousands of tables.

Retrieve a short list of relevant tables before you generate SQL. Build a table index from names, descriptions, and sample values. Give the model only the selected schema and a few example queries. Validate the SQL against the schema and run it in a read-only sandbox.

8. Design a meeting assistant: recording, diarisation, summary, action items, integrations.

Record audio, run speech-to-text with a diarisation model, then summarise with an LLM. Ask the model to return action items as JSON with owner and due date. Push results to calendar and task tools through typed API calls. Keep the transcript so users can check each summary claim.

9. Design an LLM gateway: routing across providers, failover, caching, budgets and rate limits.

Put one gateway in front of all providers. It routes each request by model, cost, and health, and it fails over to a second provider on error. Keep a shared cache for repeated prompts and count tokens per user for budgets and rate limits. A cache hit costs zero FLOPs and saves the full provider charge.

route = pick(model, cost, health)
try: return call(route, prompt)
except: return call(backup, prompt)

10. Design the serving stack for a consumer chat assistant at hundreds of millions of users.

Use a tiered stack with a global load balancer, stateless API servers, and a GPU pool that runs paged attention. Keep the KV cache on the GPU and share prefixes across users. Add a tokenizer service and a queue for long jobs. Paged attention cuts KV cache waste, and prefix sharing lowers GPU cost for common system prompts.

api -> queue -> gpu_pool(paged attention)
kv_cache: on GPU, shared prefixes
tokenizer: separate service
Related lessons
Ai system architecture Ai deployment Ai agent intro Ai transformer