Free NVIDIA Generative AI & LLMs (NCA-GENL) practice — 6 questions on Prompt Engineering, with explanations. No sign-up.
Full 12-question mixed test →
Question 1 of 6 · Prompt Engineering
A financial services company is building a fraud detection system that analyzes transaction narratives. The LLM must extract structured data (amount, merchant, location) from unstructured text while maintaining zero hallucination tolerance for numerical values. Initial tests show the model occasionally invents amounts when none are explicitly stated. Which prompt engineering technique BEST addresses this requirement?
Chain-of-thought with explicit NULL handling and structured output (JSON schema) directly addresses hallucination by forcing the model to acknowledge missing data rather than fabricate it. Structured output constraints in modern LLMs (2026) enforce schema compliance and type validation, preventing numerical hallucinations.
Question 2 of 6 · Prompt Engineering
An e-commerce platform uses an LLM to generate product descriptions from specifications. During load testing, the team discovers response times vary dramatically (200ms to 8000ms) for similar input lengths. Analysis shows 15% of requests trigger the model's maximum context window, causing performance degradation. The specification data averages 3200 tokens. Which optimization provides the MOST efficient solution?
Hierarchical prompt design optimizes for the common case (85% of requests) by keeping them under context limits while handling edge cases separately. This directly addresses the performance issue by preventing most requests from hitting the expensive maximum context processing path, reducing both latency and cost.
Question 3 of 6 · Prompt Engineering
A healthcare application uses prompt chaining to process patient intake forms: (1) extract symptoms, (2) map to ICD-10 codes, (3) suggest diagnostic tests. During audit, 8% of chains produce incorrect ICD-10 codes despite correct symptom extraction. The symptom-to-code mapping prompt uses 50 few-shot examples. Further investigation reveals errors cluster around rare conditions (< 1% prevalence). What is the ROOT CAUSE of this failure pattern?
Few-shot example selection bias is the root cause. When examples heavily weight common conditions, the model learns to pattern-match toward those exemplars. Rare conditions lack representation, causing the model to force-fit them into similar common categories. This is a classic prompt engineering failure in imbalanced domains.
Question 4 of 6 · Prompt Engineering
A legal tech company builds a contract analysis system using constitutional AI principles to ensure outputs never suggest illegal clauses. The system uses a two-stage prompt: (1) constitutional critique evaluating legality, (2) revision incorporating critique. Testing reveals the revision stage sometimes ignores critique warnings, proceeding with problematic clauses. Token analysis shows critique outputs average 450 tokens, while revision prompts receive full contract text (4200 tokens) plus critique. Which architectural change BEST ensures critique adherence?
Micro-task decomposition isolates each problematic clause with its specific critique, eliminating information overload (4650 total tokens) and ensuring focused attention on each issue. This architectural pattern prevents critique dilution in large contexts and makes validation explicit per clause—directly addressing the root cause of ignored critiques.
Question 5 of 6 · Prompt Engineering
A customer service chatbot uses persona prompting with the instruction: 'You are a friendly, empathetic support agent named Alex.' A/B testing reveals 22% higher customer satisfaction versus generic prompts, but compliance review flags 40 conversations where 'Alex' disclosed personal opinions on company policies rather than stating official policy. The chatbot uses RAG with a policy knowledge base. Which prompt modification MOST effectively maintains the satisfaction benefit while ensuring policy compliance?
Architectural separation (two-model system) provides guaranteed policy accuracy by routing policy content through a specialized model optimized for factual accuracy and source citation, while preserving the persona model's empathy benefits for non-policy interactions. This enforces the compliance boundary at the system level rather than relying on prompt instructions.
Question 6 of 6 · Prompt Engineering
A research team evaluates prompt strategies for mathematical reasoning tasks. Strategy A uses zero-shot chain-of-thought ('Let's think step by step'). Strategy B uses few-shot with 8 worked examples. Strategy C uses least-to-most prompting (decompose problem, solve subproblems). Testing on 500 problems shows: Strategy A: 68% accuracy, avg 850 tokens/response. Strategy B: 79% accuracy, avg 1240 tokens/response. Strategy C: 82% accuracy, avg 2100 tokens/response. API costs are $0.02/1K tokens (input+output combined). The production system will process 2M problems/month. Which strategy optimizes for cost-effectiveness at ≥75% accuracy?
Token optimization of Strategy B (reducing 1240→900 tokens via compression) maintains accuracy above 75% threshold while minimizing cost. At 900 tokens × 2M problems × $0.02/1K = $36,000/month, this provides the best cost-effectiveness meeting requirements. Few-shot examples can be compressed (removing verbose steps, using math notation) without losing pattern-matching value.
Ready for the real thing?
The full course: two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed explanations.
$54.99$17.99 with code FREETEST33 — valid through August 23.