Your product team needs model output that software can read reliably. How do you design the prompt?
What the interviewer wants to hear
- Define exact fields and types, ideally a JSON schema
- Use structured output or tool calling features where available
- Show an example and handle missing values with null
- Validate output and retry on failure
Model answer
I first agree with the engineers on the exact fields, types and allowed values, written as a JSON schema. In the prompt I explain each field briefly, say what to do when information is missing, usually return null rather than guessing, and show one complete example of valid output. If the platform supports structured output or tool calling with a schema, I use it, because it is much more reliable than asking nicely for JSON. I keep the temperature low. Even then, the software should validate every response against the schema and business rules, and retry or flag it for review if something is wrong. I test the prompt on varied real inputs, including messy and incomplete ones, and track the validation failure rate.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy Prompt Engineer questions
- What makes a good prompt? Walk me through how you would write one for a new task.
- When would you use zero-shot prompting and when would you add few-shot examples?
- How can you use prompting to reduce hallucinations?
- Describe your process for improving a prompt that is giving mixed results.
- Explain temperature and top-p. How would you set them for different tasks?
- Explain retrieval-augmented generation (RAG) to a non-technical colleague. Why would we use it?
- What are tokens and context windows, and why do they matter when you design prompts?
- What is chain-of-thought prompting, and when would you use it or avoid it?
- A prompt works on your demo examples but fails for some users. How do you find out why?