What this prompt does
This prompt turns the AI into a structured interview tutor for a coding problem. You paste a [problem_description] and it returns ten parts: clarifying questions to ask the interviewer, a brute-force solution with complexity analysis, an optimized solution using [approach_hint], time and space complexity for each approach, a dry run on [example_input], the [edge_cases] to handle, a clean [language] implementation, follow-up variations, similar problems for pattern recognition, and a verbal explanation script for the whiteboard.
The structure works because interview performance is about reasoning out loud, not just reaching an answer. By separating clarifying questions, brute force, optimization, and a verbal script, the prompt mirrors the exact sequence a strong candidate follows live. Most candidates lose points not by failing to solve the problem but by jumping straight to code without asking about constraints or stating complexity, and this structure forces those steps to the surface. The [approach_hint] steers toward the intended technique so you practice the pattern the interviewer expects, while [difficulty] and [time_target] calibrate the depth and pacing of the response.
When to use it
- You are working through a specific problem and want a full interview-grade breakdown.
- You need to see the brute-force-to-optimized progression, not just the final answer.
- You want the time and space complexity reasoned out for each approach.
- You are weak on explaining your thinking and need a verbal whiteboard script.
- You want the
[edge_cases]enumerated so your solution handles them. - You want similar problems to build pattern recognition across a topic.
Example output
Expect a structured walkthrough: a short list of clarifying questions, a brute-force approach with O-notation, an optimized solution using [approach_hint] with a step-by-step dry run on [example_input], clean [language] code, an enumerated edge-case list, follow-up variations, related problems, and a paragraph of what to say aloud while coding.
Pro tips
- Set
[approach_hint]only if you genuinely want to practice that technique; leave it open if you want to test whether you can find the optimal pattern yourself. - Give a concrete
[example_input]so the dry run is specific and you can verify the logic by hand rather than trusting it. - List the real
[edge_cases]you tend to forget — empty inputs, duplicates, negatives — so the code explicitly covers your blind spots. - Use the verbal script as practice material, not a recitation; read it aloud and rephrase in your own words to build genuine fluency.
- Match
[language]to the one you will actually interview in, since idiomatic code differs and you want to rehearse the syntax you'll use. - Use the
[time_target]to pace yourself realistically; solving slowly with perfect explanation still fails a timed round, so practice both correctness and speed together. - After the breakdown, attempt the similar problems before reading their solutions — pattern recognition only sticks when you struggle first.