Skip to content
TestsPrompting
Intermediate9 questions · ~12 min

Prompt Engineering & System Design

Structuring prompts, role setting, examples, output control, and reducing hallucination.

Before you start

  • 019 multiple-choice questions, one correct answer each.
  • 02Suggested time 12 minutes. The timer is a guide, not a cutoff.
  • 03Use keys 1–4 to answer, arrows to move.
  • 04You get a full explanation for every question at the end.

Study guide

Every question in the Prompt Engineering & System Design test, with the correct answer and a full explanation. Structuring prompts, role setting, examples, output control, and reducing hallucination. Use it to review before or after taking the timed quiz above — the answers are revealed here, so take the quiz first if you want an honest score.

Show all 9questions, answers & explanations
  1. PE-01 · Question 1 of 9

    Which technique most reliably improves accuracy on multi-step reasoning tasks?

    • ARaising `temperature` to encourage exploration
    • BAsking the model to think step by step before answering Correct answer
    • CShortening the prompt to save tokens
    • DRepeating the question several times

    Why: Eliciting step-by-step reasoning (chain-of-thought) before the final answer improves performance on multi-step problems by giving the model space to work through intermediate steps.

  2. PE-02 · Question 2 of 9

    You want the model to return only valid JSON with no prose. What is the most robust approach?

    • APolitely ask once and hope for the best
    • BSpecify the exact schema, and prefill the assistant turn with the opening `{` Correct answer
    • CSet `temperature` to 1 for creativity
    • DSend the request twice and compare

    Why: Describing the exact schema plus prefilling the assistant response with the opening token (e.g. `{`) strongly constrains the model to continue in that format, suppressing preamble. Tool use / structured outputs are even stronger when available.

  3. PE-03 · Question 3 of 9

    Why are XML-style tags (e.g. <document>...</document>) commonly used in Claude prompts?

    • AThey are required by the API
    • BThey clearly delimit distinct parts of the prompt, reducing ambiguity Correct answer
    • CThey reduce token cost
    • DThey enable streaming

    Why: Claude responds well to clear structure. Tags unambiguously separate instructions, context, examples, and data, which reduces the chance the model confuses one section for another.

  4. PE-04 · Question 4 of 9

    What is the main purpose of providing a few worked examples in the prompt (few-shot prompting)?

    • ATo fine-tune the model weights
    • BTo demonstrate the desired format and reasoning pattern Correct answer
    • CTo increase the context window size
    • DTo disable safety filters

    Why: Few-shot examples show the model the expected input/output mapping and style at inference time. No weights change; the examples condition the response within the current request.

  5. PE-05 · Question 5 of 9

    Which instruction best reduces fabricated answers when the context may not contain the answer?

    • A"Always provide an answer, even if unsure."
    • B"If the answer is not in the provided context, say you don't know." Correct answer
    • C"Be as creative as possible."
    • D"Ignore the context and use general knowledge."

    Why: Giving the model an explicit, acceptable 'out' — permission to say it doesn't know when the grounding context lacks the answer — is one of the most effective ways to cut hallucination in retrieval settings.

  6. PE-06 · Question 6 of 9

    For a classification task, where should the long reference material generally go relative to the instructions?

    • ALong context first, then the question/instructions near the end Correct answer
    • BInstructions only; never include reference material
    • CInterleaved randomly to add variety
    • DAlways after the model's answer

    Why: Placing large bodies of context near the top and the specific task/question near the end of the prompt tends to improve performance, especially with long documents.

  7. PE-07 · Question 7 of 9

    You give the model a role like "You are a senior tax accountant." What is the primary benefit?

    • AIt increases the context window
    • BIt grants access to private data
    • CIt steers tone, vocabulary, and the depth of domain reasoning the model applies Correct answer
    • DIt guarantees factual correctness

    Why: Role prompting in the system prompt frames the persona and expertise the model adopts, shaping tone, terminology, and how thoroughly it reasons in that domain. It does not add data or guarantee accuracy.

  8. PE-08 · Question 8 of 9

    When you let the model reason step by step but want a clean final answer, what is a robust way to structure the output?

    • AForbid any reasoning so the answer is short
    • BHave it reason inside tags (e.g. <thinking>) and put the final answer in a separate, clearly delimited section Correct answer
    • CSet `temperature` to 1
    • DAsk it to answer first, then think

    Why: Separating scratch reasoning (e.g. a <thinking> block) from a delimited final answer lets the model work through the problem while giving you an easy section to parse or display. Asking for the answer before the reasoning defeats the purpose of chain-of-thought.

  9. PE-09 · Question 9 of 9

    Your prompt mixes instructions, a user question, and a long reference document, and the model sometimes follows instructions hidden in the document. What prompt-level change helps most?

    • ADelete the reference document
    • BClearly delimit the document (e.g. in tags) and tell the model to treat its contents as data, not instructions Correct answer
    • CRaise `max_tokens`
    • DMove the instructions into the document

    Why: Wrapping untrusted material in tags and explicitly stating it is reference data the model should not obey reduces instruction-following leakage from the content. This is also a first line of defense against prompt injection.