What this prompt does
This prompt turns the AI into a focused trainer for a single algorithm pattern instead of a generic problem dispenser. You set [pattern_name] (Sliding Window, BFS/DFS, DP, and so on) and the AI builds a structured module around it: a core-concept explanation with an ASCII diagram, the signals that tell you the pattern applies, a generic template in [language] that works for most problems in that family, and a difficulty-ordered set of practice problems. Because it isolates one pattern at a time, it forces the kind of deliberate practice that actually rewires how you read problem statements rather than how you memorize answers.
The variables shape the depth and breadth of each session. [problem_count] controls how many ordered-by-difficulty problems you get, while [related_patterns] drives a comparison section so you learn when to choose this pattern over neighbors that look deceptively similar. [quiz_count] sets the size of the closing interactive quiz, where the AI hands you raw problem descriptions and you name the pattern before seeing the answer. The instruction to ask you to solve before revealing solutions is what keeps the whole thing a drill rather than a lecture you passively read through.
When to use it
- Preparing for technical interviews where pattern fluency beats memorizing individual solutions
- Refreshing a specific weak pattern like Dynamic Programming before a coding round
- Building a study plan that covers patterns one at a time instead of random grinding
- Teaching a junior developer how to recognize problem signals in plain English
- Re-grounding your instincts after a long stretch away from algorithm work
- Comparing confusable patterns so you stop reaching for the wrong template under pressure
Example output
You get a structured module: a titled concept section with an ASCII diagram, a bulleted list of when-to-use signals, and a reusable code template in your chosen language, followed by a numbered, difficulty-ordered problem set with hints. For each problem it points out the signal in the statement that flags the pattern. It closes with a comparison against [related_patterns], a list of common beginner mistakes, time and space complexity analysis for the template, and an interactive quiz that waits for your answers before grading them.
Pro tips
- Set
[pattern_name]to one pattern per session; combining several dilutes the deliberate-practice effect that makes this work - Match
[language]to your interview language so the template code is immediately usable without translation - Keep
[problem_count]modest (4 to 6) so you actually solve each one instead of skimming the answers - Fill
[related_patterns]with patterns you personally confuse, not generic neighbors, to sharpen the comparison section - Honor the "solve before revealing" instruction; if the AI dumps answers early, tell it to wait and re-ask the question
- After the quiz, ask it to regenerate only the
[quiz_count]problems you missed, this time at a higher difficulty