Chain-of-thought prompting asks the model to write out its reasoning steps before it gives the final answer. The steps are ordinary output tokens, so you can see them.
Solve the problem. Think step by step inside <scratchpad> tags.
Then give only the result on a line starting with "Answer:".
Problem: {{problem}}
It helps because the model computes one token at a time. Written steps become context that later tokens can read, so the model need not jump straight to the result. That pays off on multi-step arithmetic, logic puzzles, and rule-heavy classification.
The cost is extra tokens and latency, and it rarely helps on lookup or short rewrites. Parse the answer from the marked line, not the whole text.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Saved in this browser - sign in to keep your review list.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Keep going - a few more words and AI can grade it.
Interview lens
How interviewers actually use this question
Likely follow-ups
Why does the reasoning have to come before the answer rather than after it?Start from left-to-right generation. Say what an answer written first can read, and what steps written after it turn into.
Your app shows users only the answer. How do you keep the reasoning out and still get the benefit?Put the reasoning in its own tags, or in a JSON field placed before the answer. Strip it before display, and note you still pay for those tokens.
Chain-of-thought prompting means asking the model to write out its reasoning steps before it gives the final answer.
In practice I tell it to think step by step inside scratchpad tags, then put only the result on a line that starts with Answer.
It works because the model produces one token at a time, and the steps it writes become context that later tokens can read.
So it doesn't have to jump straight to the result, and that pays off on multi-step arithmetic, logic puzzles and rule-heavy classification.
In code I parse the answer from that marked line, not from the whole response.
The cost is extra tokens and latency, and it rarely helps on lookups or short rewrites, so I leave it off for those.
Weak answers to avoid
Stops at 'add think step by step'That's the trigger, not the reason. Explain that written steps become context later tokens can read, and name the tasks where that helps.
Says it always improves outputIt costs tokens and latency, and it rarely helps lookups or short rewrites. Say which tasks gain: multi-step math, logic, rule-heavy classification.
Says the model 'thinks harder'Vague and anthropomorphic. The steps are ordinary output tokens, and the gain comes from later tokens being able to read them.
Parses the whole response for the answerThe parser can pick up numbers and guesses from inside the reasoning. Put the final answer on its own marked line or tag and parse only that.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.