Sample questions
Question 1Easy
- Sending one prompt to several models and averaging them
- Splitting a task into steps where each output feeds the next prompt
- Concatenating several user questions into one long prompt
- Repeating the same prompt again and again until the answer stops changing
Answer: B. Splitting a task into steps where each output feeds the next prompt
Explanation
Chaining breaks a complex job into simpler, checkable steps, with code able to validate between steps.
Step-by-step solution
- Prompt chaining splits one large task into smaller steps.
- The output of one prompt becomes the input of the next.
- Code can check each step before moving on. Marked answer: splitting a task into steps where each output feeds the next prompt.
Why the other options are wrong
- A. Sending one prompt to several models and averaging the results is not chaining.
- C. Joining several questions into one long prompt is not chaining.
- D. Repeating the same prompt until the answer stops changing is not chaining.
Tip: Chaining means output of step one is input to step two, so each step can be tested on its own.
Question 2Easy
Role prompting ("You are a senior tax accountant...") mainly influences:
- Tone, vocabulary and the framing of answers
- The facts stored inside the model's weights
- Which tools the API makes available
- The number of tokens the model can read
Answer: A. Tone, vocabulary and the framing of answers
Explanation
A role sets style and perspective; it cannot add knowledge the model lacks.
Step-by-step solution
- A role sets perspective.
- It changes tone, vocabulary and framing.
- It does not add facts.
Why the other options are wrong
- B. Facts come from training.
- C. Tools are set in API.
- D. Context window is fixed.
Question 3Easy
A prompt puts its instructions first, then a 20-page document. Answers often ignore a key instruction. Which restructuring usually helps with long inputs?
- Delete the document and rely on the model's own memory
- Move the instructions into the middle of the document text
- Raise the temperature so the model reads the text more carefully
- Restate the key instruction after the document
Answer: D. Restate the key instruction after the document
Explanation
With long contexts, putting the question or key instruction at the end, close to where generation starts, tends to improve adherence.
Step-by-step solution
- Key instruction at start is ignored in long texts.
- Putting instruction near the end helps model focus.
- Restating key instruction after document makes it clear.
- Model follows rephrased instruction better at end.
- Final answer: Restate the key instruction after the document.
Why the other options are wrong
- A. Deleting the document removes the information the answer must use, so memory cannot replace it.
- B. Moving instructions into the middle of a long document makes them easier to miss, not more likely to be followed.
- C. Temperature controls randomness of output, not how carefully the model reads the input text.
Tip: Move key instructions to the end for better focus in long texts.
Question 4Easy
For a function-like LLM task, which output format is easiest for downstream code to consume?
- JSON matching a declared schema
- A screenshot of a rendered table
- A poem with the values hidden in it
- Free-form paragraphs of prose
Answer: A. JSON matching a declared schema
Explanation
A declared JSON schema can be parsed and validated mechanically.
Step-by-step solution
- JSON is structured and easy to parse by code.
- It matches a declared schema for validation.
- Code can process JSON without ambiguity.
- Other formats lack clear structure for automation.
- Final answer: A (JSON matching a declared schema).
Why the other options are wrong
- B. A screenshot is an image that code cannot parse as data, so it is the hardest format to consume.
- C. Values hidden in a poem cannot be read reliably by code, so this format has no clear structure.
- D. Free-form prose has no fixed fields, so downstream code would have to guess where each value sits.
Tip: Use JSON for structured outputs that need to be parsed by code.
Question 5Medium
Given the schema
{"type": "object",
"properties": {"age": {"type": "integer", "minimum": 0}},
"required": ["age"]}
which output is valid?
- {"Age": 25}
- {"age": -1}
- {"age": "25", "note": "ok"}
- {"age": 0, "note": "ok"}
Answer: D. {"age": 0, "note": "ok"}
Explanation
"25" is a string, "Age" does not satisfy the required key "age", and -1 breaks minimum 0. Extra keys are allowed because additionalProperties is not set to false.
Step-by-step solution
- Option A lacks the required key age; it has Age, which is a different key.
- Option B has age -1, which is below the minimum of 0.
- Option C has age as the string '25', not an integer.
- Option D has age 0 (an integer, valid) and an extra key note, which is allowed. Marked answer: option D.
Why the other options are wrong
- A. The key is Age, not the required age, so the object fails.
- B. -1 is below the minimum of 0.
- C. The value '25' is a string, but age must be an integer.
Tip: Check each schema rule in turn: required keys, types, then minimum or maximum values.
Question 6Medium
A model returns JSON that fails validation about 2% of the time. Which handling is most robust in production?
- Pass the invalid JSON on and let the client cope
- Strip all braces and parse the text by hand
- Raise the temperature so that the next answer is different
- Validate, then retry once with the validation error
Answer: D. Validate, then retry once with the validation error
Explanation
Feeding the validator's error back usually lets the model correct itself; after a bounded number of retries, fail gracefully.
Step-by-step solution
- Validate the JSON against a schema.
- On failure retry once with the error message.
- Fallback after that.
Why the other options are wrong
- A. Pushes errors to clients.
- B. Manual parsing is fragile.
- C. Temperature rise adds randomness.
Question 7Medium
Prefilling (starting the assistant's reply with "{" for the model to continue) is used to:
- Push the model straight into the desired format
- Lower the per-token price of output
- Disable the model's safety training for that particular reply
- Hide the system prompt from the user
Answer: A. Push the model straight into the desired format
Explanation
Starting the reply with the opening of the format steers continuation and skips preambles like "Sure, here is...".
Step-by-step solution
- Prefill starts the reply with chosen text.
- Starting with { pushes JSON.
- The model continues in that format.
Why the other options are wrong
- B. No price change.
- C. It does not disable safety.
- D. It does not hide the system prompt.
Question 8Medium
A JSON schema for an output object has "additionalProperties": false. What does that mean?
- Every listed property becomes optional by default
- Keys not listed under properties make the object invalid
- The object may contain only keys whose values are strings, not numbers
- Nested objects inside it are not validated at all
Answer: B. Keys not listed under properties make the object invalid
Explanation
additionalProperties: false forbids keys that are not declared, which stops the model inventing extra fields.
Step-by-step solution
- AdditionalProperties false means the object may contain only the keys listed under properties.
- Any extra key that is not declared makes the object invalid.
- Marked answer: keys not listed under properties make the object invalid.
Why the other options are wrong
- A. Optional or required status is set by the required list, not by additionalProperties.
- C. The keyword says nothing about the type of values.
- D. Nested objects are checked by their own schema.
Tip: Set additionalProperties false on output objects to stop the model adding invented fields.
Question 9Hard
An extraction prompt asks for a "date" field. Outputs come back as "5/6/24", "June 5" and "2024-06-05". What is the best fix?
- Specify ISO 8601 (YYYY-MM-DD) in the schema and validate it
- Raise the temperature so dates become more varied
- Accept any string and parse it later by guessing
- Ask for the date twice and keep whichever answer is longer than the other
Answer: A. Specify ISO 8601 (YYYY-MM-DD) in the schema and validate it
Explanation
An explicit format plus validation removes ambiguity such as day/month order.
Step-by-step solution
- ISO 8601 format ensures dates are written as YYYY-MM-DD.
- This avoids confusion between day and month orders.
- Validation catches incorrect or inconsistent date entries.
- Explicit format makes parsing easier for systems.
- Correct answer is A (Specify ISO 8601 (YYYY-MM-DD) in the schema and validate it).
Why the other options are wrong
- B. Higher temperature makes output more random, so the date formats would vary even more.
- C. Guessing how to parse each date later is fragile; the format should be fixed in the schema.
- D. Asking twice and keeping the longer answer picks by length, which says nothing about correctness.
Tip: Always use standardized formats for dates to avoid confusion and ensure reliability.
Question 10Hard
Structured output is guaranteed schema-valid by constrained decoding. Which problem can still occur?
- Required keys can be missing from the object
- Values can be well-typed but factually wrong
- An enum field can hold an unlisted label
- The JSON can have unbalanced curly braces
Answer: B. Values can be well-typed but factually wrong
Explanation
Constrained decoding guarantees shape, not truth: a valid integer or enum value can still be the wrong one, so semantic checks are still needed.
Step-by-step solution
- Constrained decoding guarantees the shape: braces, keys, types and enum labels are all valid.
- It cannot check facts, so a valid integer can still be the wrong number.
- Marked answer: values can be well-typed but factually wrong.
Why the other options are wrong
- A. The schema requires the keys, so constrained decoding keeps them.
- C. An enum allows only listed labels, so an unlisted label is blocked.
- D. Valid structure, including balanced braces, is guaranteed by the grammar.
Tip: Schema validity checks the shape; you still need a separate check for whether the values are true.
Practise all 24 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →