tezvyn:

How would you construct zero-shot and few-shot prompts for feedback classification?

AI-drafted, machine-checkedSource: promptingguide.aibeginner

Tests knowledge of zero-shot versus few-shot prompt structure. Zero-shot gives instructions, labels, and format without examples; few-shot prepends 2-4 labeled demonstrations before the target input. Red flag: calling an example-containing prompt zero-shot.

WHAT THIS TESTS: This question evaluates whether you understand the foundational distinction between zero-shot and few-shot prompting as defined in standard prompt engineering literature. The interviewer wants to see that you know zero-shot relies purely on instruction tuning and pre-trained knowledge, while few-shot leverages in-context learning through explicit demonstrations. They also want to see that you can describe the concrete structural differences in how you would actually write the prompts for a real classification task.

A GOOD ANSWER COVERS: First, describe the zero-shot prompt structure: an explicit instruction stating the classification task, the three valid categories which are Bug Feature Request and Question, the input variable placeholder for user feedback, and the expected output format such as a single label or JSON. Second, describe the few-shot prompt structure: the exact same instruction block followed by two to four labeled examples showing raw feedback text mapped to their correct category, then the target feedback appended at the end with an empty label for the model to complete. Third, highlight the key structural difference: zero-shot contains zero demonstrations and relies on the model's pre-existing understanding of the categories, while few-shot contains concrete input-output pairs that condition the model on the desired pattern. Fourth, mention that the examples in few-shot should be diverse, correctly labeled, and placed after the instruction but before the target input.

COMMON WRONG ANSWERS: A major red flag is claiming that zero-shot prompts can include examples or demonstrations; by definition zero-shot means no examples. Another error is describing few-shot prompts that lack output labels or that use examples unrelated to the target task. Some candidates also confuse the two by saying the only difference is prompt length rather than the presence of labeled demonstrations. Finally, suggesting that you would use a different model for each approach shows a misunderstanding; the difference is purely in prompt construction.

LIKELY FOLLOW-UPS: The interviewer may ask how many examples are optimal for few-shot, typically two to four depending on context window and complexity. They might ask what to do if few-shot still fails, leading to chain-of-thought or fine-tuning discussions. They could also ask how you would handle class imbalance in your few-shot examples, or whether you would include reasoning in the demonstrations. Another common follow-up is asking how temperature or top-p settings might affect classification consistency across the two approaches.

ONE CONCRETE EXAMPLE: For zero-shot you might write: Classify the following user feedback into one of these categories: Bug, Feature Request, or Question. Provide only the category name. Feedback: The login button is unresponsive on mobile. Category: For few-shot you would prepend examples: Feedback: I wish there was a dark mode. Category: Feature Request. Feedback: How do I reset my password? Category: Question. Then append the target feedback. The structural difference is the presence of those labeled pairs.

Read the original → promptingguide.ai

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.