DevPrep

All topics › AI fundamentals for developers

What is a prompt and what makes a good one?

Junior PRO

Essence

A prompt is everything the model receives before it answers: your text, pasted code, files the agent read on its own, and the tool's own instructions. The model doesn't know your project, your conventions or what you "meant". It continues the text in the most probable way, so a vague request gets an average answer and a precise one gets an answer tailored to your task.

A useful mental model from Anthropic's documentation: treat the model as a strong but brand-new colleague who is seeing your code for the first time. If a colleague without context wouldn't understand your request, the model won't either.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store