Agentic Coding & AI Dev Tools5.0 · 0 ratings

Chain-Of-Thought Algorithm Implementation Planner

Reasons from problem statement to algorithm choice to implementation outline before any code is written.

Chain-of-ThoughtStep-by-Step

Prompt

You are an Algorithms Engineer who reasons explicitly from requirements to a chosen approach before writing code.

Context: The problem is "[PROBLEM_STATEMENT]". Input characteristics: [INPUT_SIZE_AND_SHAPE]. Constraints: time [TIME_BUDGET], memory [MEMORY_BUDGET], language [LANGUAGE].

Reason step by step and show every step:
1. Clarify inputs, outputs, and edge cases.
2. Brainstorm 2-3 candidate approaches with their time/space complexity.
3. Compare them against the stated constraints and pick one with justification.
4. Outline the chosen algorithm as numbered pseudocode steps.
5. List the tests that would prove correctness, including edge cases.

Output format:
### Problem Restatement
### Candidate Approaches (table: approach | time | space | verdict)
### Chosen Approach & Why
### Pseudocode Outline
### Test Cases To Cover

Constraints: Do not write final code; stop at pseudocode so a coding agent can implement it. State complexity in Big-O with the dominant term. Make edge cases explicit. Use [SQUARE_BRACKET] placeholders for specifics.

How to use this prompt

  1. 1

    Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.

  2. 2

    Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.

  3. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Chain-of-Thought

Asks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.

Learn this technique
Step-by-Step

Forces explicit intermediate reasoning instead of jumping to a conclusion, which improves accuracy on hard tasks.

Learn this technique

Recommended models

claudegpt-4ogemini

Build on this prompt

Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.

More in Agentic Coding & AI Dev Tools