Skip to the page
Tecyfy

Prompting interview question · easy

What are some key principles for crafting effective prompts for large language models (LLMs)?

The short answerAn effective prompt says exactly what the task is, gives the model the context and data it needs, shows what a good answer looks like, and specifies the output format.

The full answer

An effective prompt says exactly what the task is, gives the model the context and data it needs, shows what a good answer looks like, and specifies the output format. Then it is tested against real examples and improved.

1. Be clear and direct State the task, the audience and what done looks like. "Summarise this incident report in five bullet points for the on-call engineer, starting with customer impact" works far better than "Summarise this". A useful test: would a capable new colleague with no background do the right thing from these words alone?

2. Give context and say why Explain the purpose behind a rule ("the answer is read aloud, so avoid tables") so the model can apply it sensibly to cases you didn't foresee.

3. Separate instructions from data Mark documents, user input and examples with clear delimiters such as XML tags or Markdown headings, so the model knows what to follow and what to work on. This also reduces the risk of text inside the data being treated as instructions.

4. Show examples A few varied examples of input and ideal output (few-shot prompting) set the format and tone more reliably than descriptions. Make them diverse, so the model doesn't copy one example's quirks.

5. Specify the output Describe the structure, length and format, or use the API's structured outputs to require JSON that matches a schema when a program will read the answer.

6. Set a role when it helps A system message such as "You are a reviewer for a payments company's SQL migrations" focuses vocabulary and judgement.

7. Break complex work down Split multi-stage tasks into steps or separate prompts, and for hard reasoning let the model work through the problem before answering (reasoning models do this on their own).

8. Allow uncertainty Tell the model it may say it doesn't know, and to answer only from the supplied material when that matters.

9. Test and iterate Keep a set of test inputs with expected results, and re-run it after every change, and when the underlying model changes.

Last updated 16 October 2026