A neural network for solving programming problems: learn, do not copy
A model can be set up so it does not hand over the answer at once but walks you up a ladder of hints. The prompt, the script and the checking tricks.
4 min · · development · автоматизация
If you ask a neural network to "solve the problem", it will. You get a green test and understand nothing, and at an interview or an exam the skill will not be there. A neural network for solving programming problems is useful when it works as a tutor: it gives hints, catches your mistakes and checks your understanding. Below is the setup for such a mode, a Python script and ways to verify the result with tests.
The principle: a ladder of hints
Instead of a ready answer, the model gives help in levels, and you ask for the next level yourself.
- Clarifying the statement. What the input is, what the output is, what the edge cases are.
- The idea. The name of an approach without details: "think about two pointers", "a hash table works here".
- The plan. Steps in words or pseudocode, but not code.
- Code only after your attempt. You send your own solution, the model points to the error but does not rewrite everything.
This is implemented with a system prompt. A working version:
You are a programming tutor. Rules:
1. Do not give a finished solution until the student sends their own attempt.
2. Give hints in levels: statement, idea, plan, and only then a targeted fix.
3. End every answer with one question that checks understanding.
4. If the student sends buggy code, point to the line and the kind of problem, but do not fix it for them.
5. If the student says "just give the answer", remind them of the rules and offer the next hint level.
Language: English. Code examples only in the language the student is using.Keep in mind that a model can break the rules under persistent pressure. That is fine: you decide whether to use the mode honestly. If your course or contest has its own rules on AI use, follow them.
A tutor script in Python
A minimal version with dialogue memory:
from openai import OpenAI
client = OpenAI(base_url="https://api.zukko.pro/v1", api_key="fetch_your_key")
SYSTEM = open("tutor_prompt.txt", encoding="utf-8").read()
history = [{"role": "system", "content": SYSTEM}]
print("Paste the problem statement, then chat. Empty line to exit.")
while True:
user = input("> ").strip()
if not user:
break
history.append({"role": "user", "content": user})
r = client.chat.completions.create(
model="claude-sonnet-5-5",
messages=history,
max_tokens=800,
)
answer = r.choices[0].message.content
history.append({"role": "assistant", "content": answer})
print(answer, "\n")Multi-line code is easier to paste through a file or the browser chat. If you just want an interface without code, the same system prompt works in the chat on zukko.pro. Request parameters are described in the chat completions docs.
How to check your own solutions
The main idea: tests should check, not the model.
Your own tests first
Before showing a solution, write three or four tests: a normal case, empty input, minimum and maximum, repeated elements. You can ask the model to come up with edge cases ("name five inputs on which a typical solution breaks"), but compute the expected result yourself.
Brute force against the fast solution
For contest problems the stress-test trick works. You write a slow but obviously correct solution (brute force) and a fast one. Then run both on random data:
import random
def brute(a): # slow but clear
...
def fast(a): # what you came up with
...
for _ in range(1000):
a = [random.randint(-5, 5) for _ in range(random.randint(1, 8))]
assert brute(a) == fast(a), aIf the assert fails, you have a concrete small example on which the solution breaks. Take that to the model: "here is the input and two answers, where is my logic wrong?".
Analysing errors without fixing them
There is a separate template for a traceback:
Here is the error and my code. Do not fix it. Explain:
1) what the message means in plain words,
2) on which line and why it happens,
3) how I could find the cause myself if I did not know the answer.The third point matters most: you learn debugging, not copying.
What to ask the model for and what not
Works well:
- rephrase the statement in other words;
- compare two approaches by complexity and memory;
- find an edge case in your solution that you missed;
- after solving, suggest how to make the code more readable;
- give a similar problem that is slightly harder.
Works badly:
- "write the whole solution" before your attempt;
- judging "will it pass on time" without running: check with profiling and tests;
- computing exact values in its head, that is what the interpreter is for.
What such a trainer costs
Prices as of 18 October 2026. Assume a session of 20 turns: on average 3000 input tokens (the history grows) and 400 output tokens.
Total: 20 × 3000 = 60,000 input and 20 × 400 = 8000 output tokens.
claude-sonnet-5-5 (0.4 / 2):
60,000 × 0.4 / 1,000,000 = $0.024
8000 × 2 / 1,000,000 = $0.016
Total $0.04 per session.
deepseek-v4.1-flash (0.013 / 0.038):
60,000 × 0.013 / 1,000,000 = $0.00078
8000 × 0.038 / 1,000,000 ≈ $0.0003
Total about $0.001 per session.
This is an assumption, your session will have different numbers: look at the usage field. For hints and analysing algorithms a budget model may be enough, but for hard dynamic programming compare two models on your own problems. Current prices are in GET https://api.zukko.pro/v1/models.
You can connect a key in a couple of minutes: create it in the dashboard. If you need a ready list of prompts for a developer, see the post on prompts for programmers, and for comparing models for Python see the post on choosing a model for Python.
FAQ
Isn't this cheating?
It depends on how you use it. If you ask for finished code and hand it in, that is cheating. If you try first and the model only points to the mistake, it is closer to a session with a tutor. The rules of your course or contest matter more than any advice.
Which model is best for learning?
We do not claim one writes code better than another. Look at price and strength index (claude-sonnet-5-5 48, deepseek-v4.1-flash 39) and test on five familiar problems where you know the correct line of solution.
How do I stop the model from giving the solution?
A system prompt with rules, and answering persistent requests by the same template. If the model still gave the solution, start the conversation again and restate the rule in the first message.
How much does it cost per month?
With 20 sessions by the estimate above, about $0.80 on claude-sonnet-5-5 and about $0.02 on deepseek-v4.1-flash. Look at real amounts on the "Usage" page of the dashboard.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- Translating subtitles with a neural network: SRT without broken timecodesThe main risk when translating SRT with a neural network is a broken file structure. A scheme where timecodes never reach the model, and a Python script with validation.
- Editing texts with a neural network: proofreading, style and cuttingDifferent kinds of editing need different prompts. Wording for proofreading, style and cutting, how to get edits with explanations and how not to lose the author's voice.
- A neural network for writing scripts: Bash, PowerShell and PythonA model writes scripts for routine fast, but running them blindly is risky. How to state the task, demand a safe dry-run mode and check the result before launch.
- Dify in Docker: installation, first-run setup and connecting modelsInstall Dify with Docker Compose, create the admin account and connect Claude, GPT and DeepSeek models on one key. Plus what to do when containers will not start.