Courseiva
Implement generative AI solutionsmediumMultiple ChoiceObjective-mapped

AI-102 Implement generative AI solutions Practice Question

A company uses Azure OpenAI to generate code snippets. They notice that the model sometimes produces code that uses deprecated APIs. They want to minimize this without retraining the model. What should they do?

⚠ Common exam trap

Microsoft often tests the distinction between prompt engineering techniques (system messages, few-shot examples, parameter tuning) and model customization (fine-tuning), and the trap here is that candidates may confuse few-shot prompting (Option D) with a system message, not realizing that a system message provides a more persistent and scalable way to enforce behavioral rules across all responses.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Add a system message instructing the model to use only current, non-deprecated APIs.

Adding a system message in Azure OpenAI allows you to set high-level instructions that guide the model's behavior without retraining. By explicitly instructing the model to use only current, non-deprecated APIs, you leverage the system prompt's ability to influence output style and content, effectively reducing deprecated API usage in generated code snippets.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Fine-tune the model on a dataset of recent code.

    Why it's wrong here

    Fine-tuning is resource-intensive and may be overkill.

  • Set the temperature parameter to 0 to reduce randomness.

    Why it's wrong here

    Temperature does not control factual accuracy.

  • Add a system message instructing the model to use only current, non-deprecated APIs.

    Why this is correct

    System messages effectively guide model behavior.

  • Provide a few-shot example of correct code in the prompt.

    Why it's wrong here

    Few-shot examples may not generalize to all cases.

About these practice questions

Courseiva writes every AI-102 question from scratch — 945 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.