All 75 AI Engineering quiz questions below come with a short explanation, visible right on the page — no sign-in needed. They're grouped by beginner and intermediate levels and 12 subtopics, so you can revise one part at a time. Choose Try AI Engineering quiz above to take a scored run and review the questions you got wrong.
A.Each token corresponds to exactly one character of the input
B.A random string used to authenticate API calls, like an API key
C.Each token corresponds to exactly one word, split on spaces
D.A sub-word piece of text that the model actually processes
Answer: D
A token is a chunk of text the model processes, usually smaller than a word. English averages about 4 characters per token; Vietnamese with diacritics costs significantly more tokens. Every context limit and every API bill is counted in tokens, both input and output.
A.How long the model remembers a conversation before forgetting it
B.How many users may call the API concurrently on one account
C.The maximum total tokens for one call, counting both the prompt and the generated output
D.The maximum size of an uploadable file
Answer: C
The context window is the token budget for a single call, covering both the prompt and what the model generates. The model does NOT remember the conversation on its own — for it to know what was said, the application must resend the history on every request, and that history also eats into this budget.
How does the temperature parameter affect generated output?
A.It limits the answer's length
B.It adjusts the randomness when picking the next token
C.It turns on and off whether the model may look up external information
D.It decides how long the model thinks before answering
Answer: B
Temperature controls the randomness when picking the next token. Near 0, the model almost always picks the most likely token — good for data extraction, classification, JSON generation. Higher is more diverse — good for creative writing, brainstorming.
What is an embedding and what is it used for in AI applications?
A.The snippet you embed to put a chatbot on a website
B.A compressed form of the text that can be decompressed back to the original
C.The model's weights after fine-tuning on a company's own data
D.A numeric vector representing meaning; similar meanings sit close together
Answer: D
An embedding is a numeric vector (usually hundreds to thousands of dimensions) representing the meaning of text. Texts with similar meanings map to nearby vectors, measured by cosine similarity. This lets you find "how to get a refund" when the document says "refund policy" — something keyword search cannot do.
A.A technical error where an overloaded API returns unreadable garbage
B.The model generating information that sounds plausible but is wrong or invented
C.The model refusing to answer because of a safety filter
D.The model responding more slowly than usual when the prompt is long
Answer: B
Hallucination is when the model generates content that sounds plausible but is factually wrong or entirely made up — citations that don't exist, APIs that aren't real, numbers it invented. Root cause: the model is trained to produce probable text, not to look up facts.
How does a system prompt differ from a user prompt?
A.The system prompt is processed faster because its content does not count as tokens
B.The system prompt can only be set once when the API account is created
C.The two are entirely equivalent, differing only in name in the API
D.The system prompt sets the role and rules for the whole conversation and is controlled by the application
Answer: D
The system prompt is written by the application and sets the role and overall rules; the model is trained to prioritize it. The user prompt comes from the user on each turn. This boundary matters for security: user content must always be treated as untrusted.
How does a multimodal model differ from a text-only one?
A.It supports more natural languages
B.It can create images from a text description
C.It accepts images alongside text in one prompt, and the images also count as tokens
D.It runs on many kinds of hardware, including personal computers
Answer: C
A multimodal model accepts images alongside text in the same prompt. Images are split into patches and encoded into tokens — a high-resolution image can cost thousands of tokens, so it eats into the context window and the bill like text does.
A.The end date of the data used to train the model
B.The date the provider stops supporting that model version
C.The maximum number of tokens the model can process in one API call
D.The confidence threshold below which the model refuses to answer
Answer: A
Cutoff is the end point of the training data. The model doesn't know events after that date — and the danger is it usually won't say "I don't know" but will make up something plausible. For new information you must supply it via RAG or a search tool.
The model's answer is cut off mid-sentence. What is the most common cause?
A.The network connection dropped while receiving the response
B.It hit the max_tokens limit set for the call
C.The model ran out of context window so it stopped
D.A safety filter blocked the rest
Answer: B
Almost always max_tokens. The response has a field indicating the stop reason — a value reporting "hit length limit" is very different from "model ended on its own". Your app should read this field to know whether the answer is complete.
A.It routes the request to a smaller model when the question looks simple
B.An identically repeated prompt prefix is cached and billed at a lower rate
C.It compresses the prompt to use fewer tokens
D.It stores the answer so an identical question later returns instantly
Answer: B
Providers cache the START of the prompt when it is identical across requests and charge significantly less for that portion. Condition: the cached part must be at the beginning and match exactly — so put fixed content first and variable content last.
On the 10th message the model still understands context. Why?
A.The provider stores the context in their cache
B.The model gradually learns from the conversations that came before
C.The application resends the whole history each time
D.The model stores the conversation history by the user's session id
Answer: C
Because the application resends the entire history on every call. The model stores no state between calls, so everything it needs to know must be in the request itself.
A.Input tokens cost more because of the long context to process
B.Pricing is per call rather than per token
C.Output tokens cost more, often several times more
D.The two token types cost exactly the same
Answer: C
Output tokens are more expensive, usually several times more. Generating each token requires running the model sequentially for each step, while the entire input is processed in parallel in one pass.
A.The provider updated the model version between the two calls
B.The two calls were routed to two different servers
C.The model samples randomly from a probability distribution
D.The model learned from the user's earlier call
Answer: C
Because the model samples randomly from the probability distribution at each generation step, instead of always choosing the highest-probability token. Setting the control parameter to zero will greatly reduce the difference but does not guarantee identical results.
The Vietnamese version of a text costs more tokens than the English one. Why?
A.The tokenizer was trained mainly on English
B.Vietnamese uses more words to express the same content
C.The model processes non-English languages differently
D.Vietnamese tone marks are stored as separate characters
Answer: A
Because the tokenizer is trained mainly on English. Common English words are usually packed into a single token, while Vietnamese text with diacritics often gets split into multiple pieces — typically costing one and a half to two times more.
A React app calls the LLM provider API directly from the browser. What is wrong?
A.Streamed responses cannot be handled in the browser
B.The browser cannot call external APIs because of security policy
C.The latency is higher than calling through an intermediate server
D.The API key is exposed to anyone who opens the page
Answer: D
The API key is exposed to anyone who opens the page. Everything sent to the browser is readable, so others can take that key to call the API and the cost is charged to your account. Calls must go through your own server.
What does cosine similarity between two embeddings measure?
A.The angle between two vectors, irrespective of their length
B.How many words the two original passages share
C.The percentage of meaning the two passages share
D.The straight-line distance between two points in the space
Answer: A
It measures the angle between two vectors, regardless of length. Thanks to that, two passages on the same topic but with different lengths still yield a high value. A value close to one means very similar, close to zero means unrelated.
What is the risk of calling a model by a latest alias?
A.The per-token cost is higher than with a pinned version
B.The call has higher latency because the name must be resolved
C.The behaviour changes when the provider updates the model
D.The new version's features cannot be used
Answer: C
Behavior changes when the provider updates the model, without notice and without any deployment on your part. Prompts fine-tuned for the old version may produce completely different results, and the output format may also drift.
A.Limit the total number of tokens the model may generate
B.Stop the model mentioning forbidden topics
C.Stop generating when it encounters the declared sequence
D.Cancel the call when it exceeds the allowed wait
Answer: C
It stops generation when it encounters the declared string, and that string does not appear in the returned result. Useful when the output has a repeating structure and needs to be cut at the right place, or when the model tends to write extra unnecessary parts.
The model miscalculates a large multiplication. Correct product-level handling?
A.Lower the randomness parameter to its minimum
B.Let the model call a calculation tool rather than compute itself
C.Write in the prompt that the model should calculate carefully
D.Move to a larger and more capable model
Answer: B
Have the model call a calculation tool instead of computing itself. The model generates text probabilistically and does not perform arithmetic, so for important numbers, delegating the task to actual running code is the only reliable way.
D.The user can insert instructions that override the original prompt
Answer: D
Users can inject instructions that override the original prompt. The model cannot distinguish between system instructions and data, so a sentence like ignore all previous instructions is also treated as a real instruction.
What problem does RAG (Retrieval-Augmented Generation) solve?
A.Letting the model read data it never learned, through retrieved passages inserted into the prompt
B.It retrains the model on company data so it memorizes the content
C.It speeds up answers by caching frequent questions
D.It compresses the prompt to save tokens
Answer: A
RAG brings knowledge the model doesn't have into runtime: it retrieves document passages relevant to the question and inserts them into the prompt. That lets the model answer about internal and fresh data, cite sources, and be updated by simply updating the document store.
In a RAG system, why does the chunking strategy matter so much?
A.Chunking only affects indexing speed, not answer quality
B.It does not matter — the vector database optimizes the chunk size itself
C.The smaller the chunk the better, since it saves on embedding cost
D.A chunk is the retrieval unit: too small loses context, too large dilutes the vector
Answer: D
Chunks are both what gets embedded and what goes into the prompt. Too small and you lose context and get truncated answers; too large and the vector represents too many ideas, so retrieval is less accurate, and you also burn tokens. Cutting along semantic boundaries works better than fixed character counts.
A.It is a feature that only works with a model fine-tuned for each function
B.The application uploads the function's source and the model compiles and runs it
C.The model connects to the internet itself and runs the function on the provider's servers
D.The model returns an intent to call a function; the application executes it and sends the result back
Answer: D
The application declares functions with JSON schemas. The model decides whether to call one and generates the arguments. The application executes it and returns the result; the model uses that result to compose the answer. The model never runs code itself — every action is decided by the application.
What is few-shot prompting and when should it be used?
A.Sending the same question several times and taking the most frequent answer
B.Retraining the model on a few samples to update its weights
C.Splitting a complex question into several successive API calls
D.Putting a few input-output examples into the prompt so the model infers the pattern
Answer: D
Few-shot prompting puts a few input–output example pairs in the prompt so the model can imitate the pattern. It works best when you need consistent output formatting or the task has conventions that are hard to state. The model weights don't change at all — it's all in the context.
A.A way to store conversation history so the model remembers longer
B.A prompt-compression technique that drops unnecessary words
C.Chaining several API calls where one call's output is the next one's input
D.Asking the model to lay out its reasoning steps before concluding
Answer: D
Chain-of-thought asks the model to write out its reasoning steps before concluding instead of answering directly. For multi-step problems, accuracy rises significantly. The cost is longer output, so it's more expensive and slower — not worth it for simple tasks.
What is prompt injection and why is it hard to fully prevent?
A.An attacker injecting SQL into the prompt to reach the model's database
B.An error when the prompt exceeds the context window so the start is cut off
C.Slipping instructions into the data so they override the original intent
D.The provider silently adding hidden instructions to your prompt
Answer: C
Prompt injection is smuggling instructions into what should be only data, making the model follow the attacker's wishes. It's hard to prevent because for the model, instructions and data are just text — there's no hard boundary like the one between code and data in an SQL prepared statement.
A.The more passages you retrieve into the prompt, the more accurate the answer
B.Hybrid search (semantic plus keyword) usually beats either one alone
C.A poorly performing RAG system usually retrieves the wrong passages rather than being the model's fault
D.Permission filtering must happen BEFORE retrieval, not through the prompt
Answer: A
Debugging RAG starts at retrieval. Hybrid search compensates for embedding's weakness with information needing exact matches. Authorization must filter before retrieval. And more chunks don't mean better results — noise reduces quality.
Which is the right way to evaluate an LLM application?
A.You need a fixed test set with expected answers, re-run whenever the prompt changes
B.For RAG you only need to measure final answer quality, not retrieval
C.Trying a few questions and liking the answers is enough to conclude the system works
D.An LLM judge scores more accurately than a human so no comparison with manual grading is needed
Answer: A
You need a fixed eval suite rerun every time you change prompt or model. LLM-as-judge works for criteria that are hard to score mechanically but must be calibrated against humans. A RAG system must measure retrieval and generation separately. Trying a few prompts by hand is not evaluation.
Why do LLM chat applications almost always use streaming?
A.Because streaming is cheaper, with providers charging less for streamed requests
B.The model generates tokens sequentially; streaming shows the text appearing almost instantly
C.Because streaming makes the model generate much faster than a normal call
D.Because without streaming the answer length is capped very low
Answer: B
Streaming doesn't make the model faster, but it delivers the first word to the user much sooner. The key metric here is time to first token (TTFT). Waiting 8 seconds at a blank screen versus seeing text run after 0.5 seconds are two completely different experiences.
A project already uses PostgreSQL. Is a separate vector database required for RAG?
A.A dedicated vector database is mandatory; a relational database cannot store vectors
B.It is mandatory, because semantic search cannot be done in SQL
C.No — PostgreSQL's vector extension is enough at most scales
D.No need to store vectors — just store the text and compute embeddings at query time
Answer: C
Not required. pgvector lets PostgreSQL store and index vectors, enough for hundreds of thousands to a few million chunks. The biggest advantage is permission filtering and joining with business data in a single query — something that splitting into two systems makes far more complicated.
Which two techniques does hybrid search in RAG combine?
A.Semantic search in two different languages
B.Two different vector databases whose results are compared
C.Vector search and keyword search, with the rankings merged
D.A small model searching and a large model confirming
Answer: C
Semantic vector search and keyword search, then merge the rankings from both. Vector search misses queries containing product codes, proper nouns, or rare terms — exactly where keyword search does best.
Where does reranking sit in a RAG pipeline, and what does it do?
A.After retrieval, rescoring the top-K for relevance with a model that reads both together
B.During generation, choosing the next token by rank
C.Before retrieval, reordering the passages in the database
D.After generation, reordering the sentences in the answer
Answer: A
After retrieval: take roughly the top twenty to fifty results and have a dedicated model rescore their relevance. It reads the query and the document together, so it is far more accurate than comparing two precomputed vectors.
Which metrics should evaluate retrieval quality in RAG?
A.Recall@K and the precision of the retrieved passages, measured separately from answer quality
B.The average length of the retrieved passages
C.The average retrieval time per query
D.Only the final answer matters since that is what the user sees
Answer: A
Retrieval-specific metrics: the proportion of correct chunks in the top K results, and the proportion of returned chunks that are actually relevant. Keep it separate from answer quality — otherwise you can't tell whether the error is in retrieval or generation.
A.A question that depends on conversational context and cannot stand on its own
B.A question with typos that makes retrieval fail
C.A question too long for the embedding model's limit
D.A question in a different language from the documents in the store
Answer: A
Context-dependent conversational questions that don't stand on their own. A follow-up like "what about the other one" doesn't carry enough information to find documents — it needs to be rewritten into a full question before retrieval.
How does structured output (JSON schema) differ from asking for JSON in the prompt?
A.It validates that the returned values are factually correct
B.It lets the model return several formats at once
C.It is faster because the model need not think about the format
D.It constrains at the decoding layer so the output is always structurally valid
Answer: D
It constrains at the decoding layer: the model can only choose tokens that lead to a valid structure. Asking in words is just a suggestion — the model can still return JSON with missing brackets, leading prose, or missing fields.
Is it better to place reference documents at the start or end of a prompt?
A.Always at the start because the model reads top to bottom
B.Always at the end to be closest to the question
C.The start or the end both beat the middle — the model attends least to the middle
D.Position does not matter because the model treats the whole context equally
Answer: C
Start or end is better than the middle. This is called the lost in the middle effect: the model attends most to the beginning and end of the context, while information in the middle gets overlooked — and it gets worse as the context grows longer.
How should prompts for a product feature be managed?
A.Keep them in a database so they can be edited without a deployment
B.Keep them in the code as strings and tweak them when the results look poor
C.Generate them automatically with another model from a requirements description
D.Put them under version control with an eval suite that runs on every change
Answer: D
Put them under version control like source code, and have an evaluation suite that runs on change. Editing one sentence in a prompt can break other cases — without an evaluation suite, no one notices until users complain.
A.Negligibly, because the model infers it from the function name
B.It only affects documentation for developers
C.Enormously — the model chooses a tool mainly from its description and parameter names
D.It only matters once there are more than ten tools
Answer: C
A lot. The model picks a tool mainly based on the description and parameter names — that's all the information it has. Vague descriptions make it call the wrong tool or pass parameters that don't match intent.
A.When the pieces of work are genuinely separable and can run in parallel
B.When one agent's context window is not enough
C.Always better than one agent because each specializes
D.When you need it to run faster because the agents share the load
Answer: A
When the parts are genuinely independent and can run in parallel — e.g. researching three separate topics then synthesizing. Splitting work that still has dependencies only adds latency, cost, and more places to lose context.
How does an agent remember information across sessions?
A.Store it externally and retrieve it — the context window is not long-term memory
B.The model remembers by itself because it learns from earlier conversations
C.Use a model with a bigger context window to hold the whole history
D.Fine-tune the model on each user's data
Answer: A
Persist to an external store and retrieve it when needed. Context only exists within a single call — the model remembers nothing between calls, and its weights don't change with the conversation.
Is using an LLM as a judge for evaluation trustworthy?
A.Only trustworthy when using the same model as the one being evaluated
B.Not trustworthy at all; only humans can judge
C.Reasonably trustworthy, but it must be calibrated against human grading
D.Fully trustworthy because a model is more objective than a human
Answer: C
It is relatively trustworthy and very useful for running automated evaluation at scale — but it must be calibrated by comparing against human evaluation on a sample. LLM judges have their own documented biases.
The model answers wrongly but confidently. How is this handled at the product layer?
A.Lower the temperature to 0 so it stops inventing
B.Require citations, display the sources, and let the user verify
C.Use a bigger model because bigger models invent less
D.Add a line to the system prompt telling the model not to invent
Answer: B
Design the product so users can verify the answer: force the model to cite sources, show the source passages with links, and make it clear when the system finds no information. Users cannot tell a correct answer from a fabricated one if both look the same.
Where does most of an LLM application's cost come from?
A.Input and output tokens; output is pricier
B.The initial cost of fine-tuning the model
C.The vector database's storage size
D.The number of requests, regardless of length
Answer: A
Input and output tokens, with output tokens usually costing several times more. The biggest hidden cost is usually a long system prompt sent with every request, multiplied by the number of requests per day.
How should rate limits and transient errors from an LLM provider be handled?
A.Retry with exponential backoff and jitter, and have a fallback
B.Retry immediately until it succeeds
C.Report the error to the user and let them retry themselves
D.Raise the limit by upgrading the service tier
Answer: A
Retry with exponential backoff plus jitter, and have a fallback — another model or another provider. Immediate retries make many clients resend at once and prolong the overload.
A.It only works for small models under a billion parameters
B.It runs at inference time rather than at training time
C.It trains the whole model but on less data
D.It trains only a small set of added weights, far cheaper and faster
Answer: D
It only trains a small set of added weights instead of updating the whole model. That way a single machine is enough to fine-tune, and many different fine-tunes share one base model.
B.One flattens the probability distribution; the other truncates its tail
C.One is for text; the other for code
D.One affects speed; the other affects length
Answer: B
One parameter flattens or sharpens the probability distribution before sampling. The other truncates the tail: it keeps only the tokens whose cumulative probability reaches a threshold and samples among them. Tuning both at once makes the effect hard to predict.
How do a model's cost and latency scale with context length?
A.Both grow with the square of the length
B.Both stay constant because the model processes the whole context in parallel
C.Cost stays constant; only latency grows
D.Cost grows linearly; time to first token grows with the input length
Answer: D
Cost scales linearly with token count. Time to first token grows with input length, while the rate of generating subsequent tokens is fairly stable. Stuffing in hundreds of thousands of tokens noticeably increases the initial wait.
What must be done when changing the embedding model for an already-indexed corpus?
A.Convert the old vectors into the new space with a transformation
B.Only compute new vectors for documents added afterwards
C.Recompute every vector — two models' vectors are not comparable
D.Nothing is needed because embedding models are all compatible
Answer: C
Recompute all vectors. Each model has its own vector space, so vectors from two models are not comparable — even if they have the same dimensionality. Mixing them gives meaningless retrieval results.
How should a frequently changing source corpus stay in sync with a vector store?
A.Track the changes and recompute only the affected chunks
B.No sync is needed because the model has learned the documents' content
C.Reindex the whole corpus on a nightly schedule
D.Delete the old vectors and let the system recompute them on query
Answer: A
Track changes at the source and recompute only the affected chunks. Reindexing everything each time is both expensive and leaves a window of inconsistent data between runs.
What is the trade-off of self-hosting an open model versus calling an API?
A.No need to worry about latency because it runs on your own infrastructure
B.Always better quality because it can be customized
C.Always cheaper because there is no provider to pay
D.Data control and predictable cost, at the price of operating GPUs yourself
Answer: D
You get data control, stable runtime-based costs, and no vendor dependency. In exchange you have to run the GPU infrastructure yourself — and that cost is billed by the hour whether or not there are requests.
What criteria should guide model selection for a feature?
A.Pick the model with the highest score on public benchmarks
B.Always pick the largest provider's newest model
C.Measure it on an eval set for your own task, weighed against cost and latency
D.Pick the model with the largest context window
Answer: C
Measure on an eval set for your own task, then weigh that against cost and latency. Rankings on public benchmarks say very little about performance on a specific task — and for many tasks a small model does just as well.
What legal and technical preparation does sending customer data to an LLM API need?
A.Just encrypt the data in transit
B.Review the retention terms, mask the data, and inform the users
C.Nothing is needed because the big providers are all compliant
D.Just signing a contract with the provider is enough
Answer: B
Three things: review the provider's terms on data retention and use, redact or strip sensitive data before sending, and give users clear notice. Some plans retain data to improve models unless you opt out.
A prompt works well with model A but poorly with model B. What is usually the cause?
A.Each model was trained with different instruction formats and styles
B.The prompt is too long so model B ignores the end
C.Model B has a smaller context window so it cannot read the whole prompt
D.Model B was not trained on that domain
Answer: A
Each model is trained with a different instruction format and style, so a prompt tuned for one model does not carry over to another. It needs adjusting and re-evaluating when you switch.
What principles should govern few-shot example selection?
A.The more examples the better, so the model learns more
B.Diverse, including edge cases, and consistently formatted
C.Pick only the most typical examples and avoid unusual ones
D.Pick at random from real data to avoid bias
Answer: B
Diverse enough to cover different input shapes, including edge cases and cases where the correct answer is a refusal, and with output formatting completely consistent across examples.
How do reasoning models differ from ordinary models?
A.They generate an internal reasoning chain before answering, costing more tokens and time
B.They answer faster because generation has been optimized
C.They can access the Internet to look things up
D.They were trained on more data so they know more
Answer: A
They generate an extra internal chain of reasoning before giving the answer. That makes them markedly stronger at math, coding, and multi-step reasoning — at the cost of more tokens and noticeably higher latency.
How should an AI feature be designed when the model is uncertain?
A.Show the raw probability score and let the user judge
B.State the confidence level clearly and offer an escape hatch to a human
C.Hide the feature when the model is unsure
D.Always give an answer for a seamless experience
Answer: B
State the confidence level in language the user understands, and always have an option to hand off to a human or to the original source. Presenting a guess as fact loses user trust when they find out it's wrong.
What does streaming an LLM response require on the backend?
A.Wait for the whole response and send it once for integrity
B.Switch to WebSocket because HTTP cannot stream
C.Forward chunks to the client and handle disconnects
D.Save the whole response to the database before sending
Answer: C
Forward each chunk to the client as soon as it arrives, and cancel the call to the provider when the client disconnects. If you don't cancel, you still get billed for tokens generated that nobody reads.
A long conversation bloats the context. Which handling preserves quality?
A.Drop the oldest turns once the limit is exceeded
B.Keep only the last turn since that is the current question
C.Switch to a model with a bigger context window
D.Summarize the older turns and keep the last few verbatim
Answer: D
Summarize older turns into a short passage and keep the most recent few turns intact. Hard-cutting older turns loses important information stated early — names, requirements, constraints — and the model forgets the context.
Where should output guardrails for a model be placed?
A.In the system prompt by stating the rules clearly
B.Not needed, since providers already have their own filters
C.In the application layer, checking the output before displaying or acting on it
D.In the model layer by fine-tuning on safe data
Answer: C
In the application layer: check the output with code before displaying or executing it. Prompt instructions are only suggestions the model can violate — only code checks are real enforcement.
A RAG system answers wrongly. What is the first diagnostic step?
A.Look at the retrieved passages — is the right one among them
B.Increase the number of retrieved passages
C.Edit the prompt to tell the model to be more careful
D.Switch to a stronger model so it answers better
Answer: A
Look at the retrieved chunks: does the chunk containing the correct answer appear there? If not, the problem is in the retrieval layer and no amount of prompt fixing will help. If it's there but the answer is still wrong, the problem is in the generation layer.
What process should deploying a prompt change to production follow?
A.Run the evals, roll out to a fraction of users, and watch the metrics
B.Ship to every user to gather feedback fastest
C.Have one team member try a few questions and then ship
D.Edit it directly in production since a prompt is not code
Answer: A
Run the automated evaluation suite, roll out gradually to a fraction of users, and monitor quality metrics. A change that improves on the eval can still degrade cases the eval doesn't cover.
How should structured data extraction from documents with an LLM be designed?
A.Fine-tune a separate model per document type
B.Structured output against a schema, plus validation and human review of critical fields
C.Ask for JSON in the prompt and parse the result
D.Extract each field with its own call for maximum accuracy
Answer: B
Use a schema-based structured output mechanism, validate the values after receiving them, and have a human review the important fields. The structure is guaranteed, but the content of each field is not.
How does semantic search differ from keyword search in user experience?
A.It always gives better results so it should replace keyword search entirely
B.It needs no prior indexing so it is quicker to deploy
C.It finds things by meaning even with different wording, but it is harder to predict and explain
D.It is faster because it does not scan all the text
Answer: C
It finds results by meaning even when the user's words differ from the document — but it's harder to predict and harder to explain. Users don't understand why a result appeared, so they can't fine-tune the query when results aren't what they wanted.
How should data for fine-tuning a model be prepared?
A.Just taking the logs of real conversations is enough
B.Use another model to generate the data to save effort
C.The more data the better; quality can come later
D.High quality and consistency matter more than sheer volume
Answer: D
High quality and consistent format matter more than quantity. A few hundred carefully vetted examples often outperform tens of thousands of mixed ones — because bad data teaches the model those very bad patterns.
How is an AI feature's real product impact measured?
A.Positive user feedback in a survey
B.How many times the feature is used per day
C.The score on the internal eval set
D.Business metrics in an experiment with a control group
Answer: D
Use business metrics in a controlled experiment: task completion rate, completion time, rate of escalation to human support, or revenue. Output quality metrics alone don't tell you whether the feature creates value.
How does semantic caching work for LLM applications?
A.It returns an earlier answer when the new question is sufficiently similar
B.It stores the prompt's prefix so the provider processes it faster
C.It stores document embeddings so they need not be recomputed
D.It compresses the conversation history to reduce the tokens sent
Answer: A
It returns the old answer when the new question is similar enough — compared using embeddings instead of string matching. Thanks to that, different phrasings of the same idea can share results, saving both cost and latency.
How do you know a prompt exceeds the context window before calling?
A.Estimate by dividing the character count by four
B.Count the tokens with the model's tokenizer library
C.Limit the input character count in the user interface
D.Call the API and catch the error if it exceeds the limit
Answer: B
Count tokens with the model's own tokenizer library. Estimating by character count is badly off for Vietnamese, and calling then catching the error costs a failed call plus the corresponding latency.
A user closes the tab mid-stream. What must the backend handle?
A.Cancel the call to the provider so it costs nothing more
B.Resend the whole answer when the user comes back
C.Save the partial answer into the conversation history
D.Record the event for user behaviour analysis
Answer: A
Cancel the call to the provider. Without cancellation the model still generates to the end and all output tokens are still billed even though nobody receives them. Do this by propagating the HTTP request's cancellation signal down to the underlying call.
What is the impact of choosing a 3072-dimension embedding over 768?
A.It costs more memory and searches more slowly
B.It forces you to use the same model for questions and documents
C.It cannot be used with the ordinary approximate indexes
D.The retrieval quality improves proportionally with the dimensions
Answer: A
It costs four times the memory and searches are slower, while retrieval quality is usually only slightly better. With a corpus of a few million documents, the infrastructure cost difference is significant.
Source documents are PDFs with tables. What matters most before chunking?
A.Compress the files to reduce the storage cost
B.The extraction must preserve the document's structure
C.Lowercase all the content before processing
D.Translate every document into one common language
Answer: B
Extraction that preserves structure. A table read into a jumble of text lines loses the row-column relationships, and no later step can restore them. The retrieval system's quality is capped right at this step.
Should a RAG system show citations for its answers?
A.Only when the system serves the legal or medical field
B.No, since the source documents were carefully curated
C.Yes, because the user can verify the answer
D.No, because it makes the answer longer and harder to read
Answer: C
Yes. The model can still misread a correct document, and citations let users verify for themselves. They also help the team diagnose: you immediately know whether the failure is in retrieval or in answer generation.
The LLM provider has a full outage. What design keeps the feature alive?
A.Increase the timeout to give the call more chance
B.Switch to a fallback provider through an abstraction layer
C.Pre-store answers for every question that might be asked
D.Retry the call repeatedly until it succeeds
Answer: B
Fail over to a backup provider through a common abstraction layer. Application code calls through one unified interface, so switching is a config change rather than rewriting the feature mid-incident.
The model returns several tool calls in one turn. How should they be handled?
A.Run them in parallel and return all the results
B.Run only the first call and ignore the rest
C.Run them one at a time in the order the model returned
D.Ask the model to pick just one tool instead
Answer: A
Run them in parallel and return all the results in one turn. Calls in the same turn are independent by nature, so running them sequentially just adds latency. You must return a result for every call — miss one and the model cannot continue.
A product uses the strongest model for everything. What is a sensible optimization?
A.Move everything to a small model to cut the cost
B.Halve the maximum answer length
C.Batch several users' requests into one call
D.Route by each request's difficulty
Answer: D
Route by difficulty: classify requests and send simple tasks to a small model, keeping the strong model only for genuinely hard requests. Most traffic is usually simple tasks, so the savings are substantial.
Choosing a model for a Vietnamese product — what evidence is most reliable?
A.The parameter count the provider publishes
B.Community opinions on technical forums
C.Test on the product's own real data
D.Aggregate leaderboards on model comparison sites
Answer: C
Test on the product's own real data with a representative question set. Public leaderboards measure general tasks, mostly in English, so differences there do not predict quality for a specific domain.