Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Getting Started with AI for VLSI Engineers5
  • Just Enough AI: Models and Context15
  • Prompting13
    • Anatomy of a Prompt
    • Examples and Reasoning
      • Zero-Shot and Few-Shot Prompts
      • Choosing and Ordering Examples
      • Step-by-Step Reasoning Prompts
      • Self-Checks and Structured Output
    • Prompt Debugging
  • Trust and Verification14
  • Using AI for Engineering Work17
  • Engineering Walkthroughs7
  • Practical Foundations for AI Workflows4
  • Engineering Data5
  • Retrieval-Augmented Generation6
  • Agents and Tool Use18
  • Agent Design8
  • MCP and Skills6
  • Multi-Agent Design6
  • Practical Capstone6
  • Tokens, Cost and Latency12
  • Agentic Workflows for Chip Teams18
  • Interview and Judgment10
  • AI Skills: Full Course Index
  • Working with AI Glossary
  • Working with AI Cheatsheet
Loading lesson

‹Examples and Reasoning
  1. Topics
  2. AI Skills for VLSI Engineers
  3. Prompting
  4. Examples and Reasoning
  5. Choosing and Ordering Examples

Asking Clearly · Beginner to Intermediate

Choosing and Ordering Examples

Selecting examples for coverage, ordering them stably, and budgeting context.

On this page

    Picking examples

    Coverage beats count. A small set that spans the classes teaches more than a large set from one class.

    Include one boundary case per class, such as an asserted-low reset near an asserted-high one. Effects vary by model, so candidate sets are compared by measurement.

    Pool entry

    Class

    Why keep it

    rst asserted

    Active-high reset

    Anchors the plain name.

    rst_n asserted

    Active-low reset

    Anchors the suffixed name.

    enable held low

    Enable handling

    Adds a second class.

    handshake stalled

    Handshake handling

    Adds a third class.

    The program below uses fixed lists, not a model. Spread picks covering three classes beat the first three pool entries covering two.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    import sys
    
    POOL = [
        ("a", "reset"),
        ("b", "reset"),
        ("c", "enable"),
        ("d", "enable"),
        ("e", "handshake"),
        ("f", "handshake"),
    ]
    
    def covers(picks):
        seen = []
        for i in picks:
            cls = POOL[i][1]
            if cls in seen:
                pass
            else:
                seen.append(cls)
        return seen
    
    first_three = covers([0, 1, 2])
    spread = covers([0, 2, 4])
    
    if len(first_three) == 2:
        pass
    else:
        print("FAIL: first-three cover changed")
        sys.exit(1)
    if len(spread) == 3:
        pass
    else:
        print("FAIL: spread cover changed")
        sys.exit(1)
    print("PASS: spread picks cover 3 classes, first three cover 2")

    Ordering and format

    Order effects are reported for some models and absent for others. The safe rule is a fixed order with a fixed format.

    Tests reshuffle the same pairs to check stability. A set that survives reshuffling is kept; a fragile one is rewritten.

    Choice

    Stable option

    Trouble sign

    Order

    One fixed order, hardest case last

    Reshuffled orders that move the answer.

    Format

    One template for every pair

    Mixed separators and label spellings.

    Labels

    Exact strings the checker accepts

    Synonyms the checker rejects.

    Budgeting context

    Long inputs cost more and are used less reliably than short ones. Common tokenizers split English prose into subword units, about 3 to 4 characters per token as an approximate tokenizer-dependent rule.

    Code, numbers, hex, and non-Latin text use more tokens per character. In the basic attention form, cost grows with the square of the sequence length, while efficient variants exist.

    Models tend to use the start and end of long inputs better than the middle, a tendency reported in studies rather than a law. The worked budget below keeps shares exact and summing to 100 percent.

    plaintext
    1
    2
    3
    4
    5
    EXAMPLE context budget = 4000 tokens
    instruction 300, examples 2400, input 1000, reserve 300
    total = 300 + 2400 + 1000 + 300 = 4000 tokens
    shares: 300/4000 = 7.5%, 2400/4000 = 60%, 1000/4000 = 25%, 300/4000 = 7.5%
    sum = 7.5 + 60 + 25 + 7.5 = 100

    Common mistakes

    A prompt that grows without a budget eventually squeezes out the new input. Reserves protect the answer space.

    Common pitfall

    Near-duplicate pairs waste tokens while adding no class. Deduplicate by class first, then spend the freed budget on uncovered boundaries.

    Interview

    Likely probes: how example sets are chosen and stabilized.

    • Choose for class coverage first, with one boundary case per class.

    • Fix one order and one template, then test reshuffles for stability.

    • Budget shares that sum to 100 keep the input and the reserve intact.

    Check yourself Six candidate pairs cover two classes. A seventh pair covers a third class. Which change helps more than adding three lookalikes?

    Adding the seventh pair. A new class raises coverage, while lookalikes repeat a covered class.

    Check yourself In the budget above, which two blocks share 7.5 percent each, and what is their token count?

    Instruction and reserve. Each holds 300 of 4000 tokens, which is 7.5 percent.

    Related topics

    • Zero-shot and few-shot

    • Prompt debugging

    • Caches

    Previous

    27 / 173

    Next: Step-by-Step Reasoning Prompts

    Up next

    Up nextStep-by-Step Reasoning Prompts

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Self-Checks and Structured Output