Sample questions
Question 1Easy
When asking AI for help with an error, you should paste:
- Your password
- Only the first word of the error
- The full error message and stack trace
- A description of how frustrated you are
Answer: C. The full error message and stack trace
Explanation
The complete error and stack trace show what failed and where.
Step-by-step solution
- An error question needs enough detail to find the cause.
- The full error message and stack trace show what failed and where.
- So paste the full message and stack trace. The correct answer is C (The full error message and stack trace).
Why the other options are wrong
- A. Never share a password with an AI tool.
- B. The first word alone drops the detail needed to diagnose the error.
- D. Your mood does not help diagnose the error.
Tip: Include the error, the stack trace and the code that triggers it.
Question 2Easy
When asking an AI to fix a bug, which information helps MOST?
- Your screen resolution
- Only the word "bug"
- The exact error message, the relevant code and what you expected
- A list of every library you have ever installed on the laptop, for completeness
Answer: C. The exact error message, the relevant code and what you expected
Explanation
The error text, code and expected behaviour give the model the context needed to locate the cause.
Step-by-step solution
- Exact error message shows what went wrong.
- Relevant code helps find where the issue is.
- Expected behaviour explains what should happen.
- Together, they give full context for fixing the bug.
- This lets the AI understand and solve the problem.
Why the other options are wrong
- A. Screen resolution has no bearing on the bug, so it does not help the AI find the cause.
- B. The word bug alone gives no error, code or expectation, so the AI cannot diagnose the problem.
- D. A list of every installed library is mostly noise here; the error message and code matter far more.
Tip: Give exact error messages and relevant code to get better help.
Question 3Easy
Which prompt is most likely to get useful code?
- "Write something for emails."
- "Fix my code."
- "Make it better and faster and nicer."
- "Write a Python function that removes duplicate emails from a list, keeping first-seen order; inputs can be mixed case."
Answer: D. "Write a Python function that removes duplicate emails from a list, keeping first-seen order; inputs can be mixed case."
Explanation
Specific prompts state the language, input, desired behaviour and edge cases, leaving less for the model to guess.
Step-by-step solution
- Option D gives exact language: Python.
- It specifies input: list of emails.
- It says to keep first-seen order.
- It mentions mixed case inputs.
- Final answer: Write a Python function that removes duplicate emails from a list, keeping first-seen order; inputs can be mixed case.
Why the other options are wrong
- A. Asking for something for emails gives no language, input or task, so the model must guess.
- B. Fix my code gives no code, error or expected behaviour, so the model cannot know what to fix.
- C. Make it better and faster and nicer names no code, target or measure, so the answer would be vague.
Tip: Be precise with language, input, and requirements.
Question 4Easy
Assigning a role such as "You are a senior reviewer focused on security" in a prompt mainly helps to:
- Focus the response on a particular perspective
- Bypass company security policy
- Make the output legally binding
- Give the model new factual knowledge it did not have in its training
Answer: A. Focus the response on a particular perspective
Explanation
Role framing steers emphasis and tone; it does not add facts the model doesn't have.
Step-by-step solution
- Role framing focuses the response on a specific perspective.
- It guides the model to think from that role's viewpoint.
- This ensures the output aligns with the assigned role's priorities.
- It does not provide new factual information.
- Final answer: A (Focus the response on a particular perspective).
Why the other options are wrong
- B. A role does not bypass security policy; it only changes the viewpoint of the answer.
- C. A role prompt does not make output legally binding; it only frames the perspective.
- D. A role does not add facts; it only focuses the perspective, so it gives no new knowledge.
Tip: Use role framing to guide responses, not to add new knowledge.
Question 5Medium
An AI keeps returning a recursive solution, but your input can be 10^6 levels deep. What should you add to the prompt?
- A constraint like "must be iterative; input depth up to 10^6"
- A polite thank-you message
- A request to use deeper recursion with memoisation on every call
- Nothing; recursion depth is never a problem in any language
Answer: A. A constraint like "must be iterative; input depth up to 10^6"
Explanation
Stating the scale constraint explains why recursion would fail (stack limits) and steers the model to an iterative design.
Step-by-step solution
- Recursion depth of 10^6 exceeds standard stack limits.
- AI needs explicit instruction to avoid stack overflow.
- Adding constraint forces iterative solution.
- Iterative approach handles large inputs safely.
- Final answer: A constraint like 'must be iterative; input depth up to 10^6'.
Why the other options are wrong
- B. A thank-you message adds nothing to the code requirements, so the recursion problem remains.
- C. Memoised recursion still recurses a million levels deep and can overflow the stack.
- D. Recursion depth does cause stack overflow in many languages, so it is a real problem.
Tip: Always specify constraints for deep recursion to avoid crashes.
Question 6Medium
Adding "Use only the Python standard library; no third-party packages" to a prompt is an example of:
- Stating a constraint
- Asking for a summary
- Few-shot prompting
- Raising the temperature
Answer: A. Stating a constraint
Explanation
Constraints narrow the solution space so the output fits your environment and rules.
Step-by-step solution
- The added sentence limits what kind of solution the model may use.
- A limit on third-party packages is a constraint that narrows the answer.
- It is not a request for a summary, not a few-shot example, and not a temperature change.
- So the answer is option A, stating a constraint.
Why the other options are wrong
- B. Asking for a summary is a different kind of request.
- C. Few-shot prompting gives example input and output pairs, and this prompt gives none.
- D. Temperature is a sampling setting, not something added to the prompt text.
Tip: Constraints such as the allowed libraries, language or format narrow the answer to what you can use.
Question 7Medium
You want the AI to fix only a bug without restyling the file. What should you add?
- "Make the minimal change needed; don't reformat unrelated code."
- "Please rewrite the entire file using your preferred style, naming and structure."
- "Use more emojis."
- "Answer in French."
Answer: A. "Make the minimal change needed; don't reformat unrelated code."
Explanation
Asking for a minimal diff keeps the change focused and easy to review.
Step-by-step solution
- Minimal change focuses on fixing the bug only.
- It avoids unnecessary code reformatting.
- This makes the review process faster and clearer.
- Other options suggest major changes or unrelated tasks.
- Final answer: Make the minimal change needed; don't reformat unrelated code.
Why the other options are wrong
- B. Rewriting the entire file changes unrelated code and breaks the request for a minimal fix.
- C. Emojis are unrelated to fixing a bug and add noise to the code or reply.
- D. Answering in French is unrelated to the bug fix and does not limit the change.
Tip: Always ask for minimal changes when fixing bugs to keep reviews efficient.
Question 8Medium
A feature needs a database schema, an API endpoint, a UI form and tests. What is the most effective prompting strategy?
- Ask for everything in one prompt and merge the result without reading it
- Break it into smaller steps and verify each before moving on
- Repeat the same vague prompt until it works
- Ask for the UI only and hope the rest appears
Answer: B. Break it into smaller steps and verify each before moving on
Explanation
Decomposition keeps each response focused and reviewable, and errors are caught before they compound.
Step-by-step solution
- Breaking tasks into smaller steps ensures clarity and focus.
- Each step can be reviewed and fixed early to avoid mistakes.
- Verifying each part reduces the risk of errors in later stages.
- This approach saves time by catching issues quickly.
- Final answer: B (Break it into smaller steps and verify each before moving on).
Why the other options are wrong
- A. Merging a large answer without reading it skips checks and raises the risk of hidden errors.
- C. Repeating a vague prompt until it works gives no new information, so it is a weak strategy.
- D. Asking only for the UI leaves the schema, API and tests missing, so the feature is not built.
Tip: Break big tasks into small steps for better control and faster results.
Question 9Hard
You need a regex for Indian PIN codes (six digits, first digit 1-9). What is the best way to use AI here?
- Ask the AI to promise the regex is correct
- Ask for the regex plus test strings that should and should not match, then run them
- Ask for a regex with no constraints
- Use the first regex returned without testing, since regexes are standard
Answer: B. Ask for the regex plus test strings that should and should not match, then run them
Explanation
Regexes are easy to get subtly wrong; matching and non-matching test cases make the result verifiable, e.g. ^[1-9][0-9]{5}$.
Step-by-step solution
- A regex is easy to get subtly wrong.
- Ask for test cases that should and should not match.
- Then run them.
Why the other options are wrong
- A. AI cannot promise correctness.
- C. Without constraints, the regex is too loose.
- D. Always test.
Tip: Test with good and bad inputs.
Question 10Hard
A prompt asks for "a fast function". Why is this weak, and how should it be improved?
- Remove all performance requirements
- "Fast" is vague; state input size and a target such as O(n log n) or a time limit
- It's fine; models always know what fast means for your data
- Replace "fast" with "very very fast"
Answer: B. "Fast" is vague; state input size and a target such as O(n log n) or a time limit
Explanation
Measurable performance requirements let the model choose suitable algorithms and let you verify the result.
Step-by-step solution
- "Fast" is vague; models need specific targets like O(n log n) or time limits.
- Stating input size helps pick the right algorithm for performance.
- Measurable requirements allow verification of the function's speed.
- This makes the prompt clear and actionable for the model.
- Final answer: "Fast" is vague; state input size and a target such as O(n log n) or a time limit.
Why the other options are wrong
- A. Removing performance requirements makes the function vaguer, so the prompt is still weak.
- C. Models cannot know what fast means for your data without input size or a target.
- D. Very very fast is still vague and does not give any measurable target.
Tip: Always define what 'fast' means with measurable criteria.
Practise all 26 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 →