How to ask a senior developer a question and get a fast answer
How to ask a senior developer for help when stuck: when to ask, a six-part message that can be answered at once, and a script that checks the message first.
To get a fast answer without bothering a senior developer, send one message that is complete enough for the reader to answer without asking you anything back: what you are doing, the error word for word, what you tried, and exactly one question. Are you shy about asking, like Minh? Let's look at it together.
You were too shy to ask and lost an afternoon: was that worth it?
In the previous post of this series, Minh worked through the first week and got the project running. On Thursday afternoon, 3 December 2026, a strange error appeared when running the automated tests, and Minh lost almost the whole afternoon digging alone without asking anyone, because Minh did not want to bother Phúc, the mentor, and was afraid of looking not good enough. Minh is an illustrative character of this series, so every name, date and error in the post is illustrative.
The error looked like this:
Error: getaddrinfo ENOTFOUND db
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)This line says the machine cannot find the address of a host called db. In the project, db is the name of the database service in Docker Compose, and that name only works between containers.
Minh ran the tests directly on the laptop, so the name db meant nothing. The fix is to change the host in the file .env.test to localhost. Phúc would know at one glance, and it would take about a minute. Minh spent almost a whole afternoon and still had not found it.
But the opposite is also true: asking without preparing wastes the time of the person answering, and it can even be worse because it makes them lose the sense that you tried. The goal of this post is exactly in the middle: ask early enough that you do not lose a whole afternoon, and ask clearly enough that the other person can answer at once.
When should you ask, and when should you try a little more?
This is the rule I suggested to Minh. It is my own rule, your team may have different habits, so treat it as a starting point to adjust.
For a requirement that is unclear, ask before you start. Going in the wrong direction for a whole day costs much more than one question at the beginning, and it is usually not your fault but the fault of a vague requirement.
For a technical error, try on your own first, but with a time limit. I use about 30 minutes, or earlier if you have tried two different directions and neither worked. The number 30 is not a standard, it only gives you a stopping point, because people who are shy about asking often have no stopping point at all. For anything you can look up in five minutes in the README or the docs/ folder, look it up first.
There is a way to make this less of a feeling: use the end-of-day log from the previous post. The log template has a section "not understood yet (not asked yet)" and a section "tried before asking". When an item in "not understood" gets stuck past your limit, you turn it into a question, and what you wrote under "tried" is the raw material of the message. The long-standing guides to asking questions in the programming community, such as the How to ask a good question page of Stack Overflow and the article How To Ask Questions The Smart Way by Eric Raymond, also stress saying what you have tried and giving enough information for others to reproduce the problem.
What did the first message of Minh miss?
That afternoon, after losing almost the whole of it, Minh sent Phúc exactly one line. I saved it as a file, so I can score it in the next section:
Hey, my tests don't work, there's some error, can you take a look pleaseTry to put yourself in the place of Phúc, who is in the middle of his own work. After reading this message, he has to ask back almost everything. Here is the exchange I imagine (illustrative), and every turn is another wait:
Minh: Hey, my tests don't work, there's some error, can you take a look please
Phúc: What error? Paste it for me.
Minh: It says ENOTFOUND something (sends a screenshot)
Phúc: What command did you run, on which machine, and have you tried anything?
Four turns, and so far Phúc knows nothing except that there is a network error. Each turn like that makes him drop his work, read, reply, and go back, and people usually need a while to find their train of thought again after each one. It also leaves the impression that Minh tried nothing, when in fact Minh tried quite a lot. The mistake is not in asking; it is that the message does not contain the information the answerer needs.
An easy-to-answer message needs six parts
The way I usually think is: whatever the reader would ask back, put that answer in the first message. The six parts below are the six questions that Phúc had to ask back above.
- What you are doing. So that the reader understands the goal, because sometimes the right answer is "don't do it that way".
- The error or the result, word for word. Paste the text, do not only take a screenshot: text can be copied, searched and read on a phone, and an image cannot.
- What you expected and what actually happened. These two tell you where the "wrong" is.
- What you tried, at least two things, with the result of each. That way the reader does not have to suggest again the approaches you already ruled out.
- The environment: operating system, tool versions, branch or commit. Many errors only happen in one specific environment.
- One specific question at the end. "Can you take a look" is a vague favour, while "when the tests run outside Docker, what should the host be" is a question that can be answered in one line.
If you already have a hypothesis after trying, write it down right away. If it is right, the reader only needs to confirm it, and if it is wrong, they correct it much faster than they could guess what you are thinking.
Here is the message Minh sent after rewriting it. It is longer, and after reading it Phúc can answer in one sentence:
Hi Phúc, I'm stuck on running the tests of the project. Could you take a quick look?
I'm running `npm test` to check the branch minh/add-notes before I send a pull request.
I expected the tests to pass like on CI, but actually it stops with this error:
Error: getaddrinfo ENOTFOUND db
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
I tried:
- Running `docker compose up -d db` again; `docker ps` says the container is Up.
- Deleting node_modules and running `npm ci`; the same error.
- Searching for "ENOTFOUND db" in the README and in the docs/ folder; found nothing.
Environment: Windows 11, Node 22.20.0, commit 4be71a2. I created .env.test by copying .env.example.
I suspect .env.test, because DATABASE_URL points to the host "db" while I run the tests outside Docker. My question: when the tests run outside Docker, what should the host be?Notice two things in this message. The line "I created .env.test by copying .env.example" is information Minh did not think was important, but it is exactly what leads to the cause. And the part "I suspect .env.test" tells Phúc how far Minh has already got. The answer can be just: "Right, change db to localhost."
Check the message with a small script
When I am shy and in a hurry, I often forget one of the six parts. So I wrote a small script that checks a message before sending. It only checks whether each part is present, using keywords and the shape of the text, and does not judge quality. You need Node.js 22.18 or newer, because from that version Node runs .ts files directly, and nothing else needs to be installed. The folder layout:
ask/
package.json
check.ts
bad-question.txt
good-question.txt
question-template.txt
src/check-question.ts
src/check-question.test.ts{
"name": "junior-journey-10",
"private": true,
"type": "module",
"scripts": { "test": "node --test src" }
}The two files bad-question.txt and good-question.txt are the two messages above. The main part is a list of six checks. Each check is a small regular expression. For example, the check "pastes the error verbatim" looks for a line that starts with Error, Exception, Traceback, fatal: or npm ERR!, so an error that is only mentioned in the middle of a sentence ("I get Error: ...") does not count:
// Check whether a message that asks a colleague for help has all six parts. It only checks that each part is PRESENT, by keywords and shape,
// and does not judge quality: a message stuffed with keywords but empty still passes (see the last test).
export type Check = { name: string; passes: (message: string) => boolean };
export const CHECKS: Check[] = [
{ name: "says what you are doing", passes: (message) => /\bI(?:'m| am) (?:running|trying|working|writing|fixing|testing|building|stuck)/iu.test(message) },
{ name: "pastes the error verbatim", passes: (message) => /^\s*(\w*Error\b|\w*Exception\b|Traceback|fatal:|npm ERR!)/m.test(message) },
{ name: "says what you expected and what happened", passes: (message) => /\b(?:expected|expect|should have)\b/iu.test(message) && /\b(?:actually|instead|but)\b/iu.test(message) },
{ name: "lists at least two things you tried", passes: (message) => /\bI(?:'ve| have)? tried\b/iu.test(message) && (message.match(/^\s*(?:[-*]|\d+\.)\s+\S/gmu) ?? []).length >= 2 },
{ name: "gives the environment", passes: (message) => /(windows|macos|linux)/iu.test(message) && /(node|version)\s*v?\d/iu.test(message) },
{ name: "ends with a question", passes: (message) => /\?\s*$/u.test(message.trim()) },
];
export function checkQuestion(message: string): { check: string; passes: boolean }[] {
return CHECKS.map(({ name, passes }) => ({ check: name, passes: passes(message) }));
}// Score a question message before you send it. Run: node check.ts bad-question.txt
import { readFileSync } from "node:fs";
import { checkQuestion } from "./src/check-question.ts";
const file = process.argv[2];
if (!file) throw new Error("A file name is needed, for example: node check.ts good-question.txt");
const results = checkQuestion(readFileSync(file, "utf8"));
console.log(`${file}: ${results.filter((r) => r.passes).length}/${results.length} parts`);
for (const { check, passes } of results) console.log(` ${passes ? "✓" : "✗"} ${check}`);node check.ts bad-question.txt
node check.ts good-question.txtbad-question.txt: 0/6 parts
✗ says what you are doing
✗ pastes the error verbatim
✗ says what you expected and what happened
✗ lists at least two things you tried
✗ gives the environment
✗ ends with a question
good-question.txt: 6/6 parts
✓ says what you are doing
✓ pastes the error verbatim
✓ says what you expected and what happened
✓ lists at least two things you tried
✓ gives the environment
✓ ends with a questionThe one-line message scores 0 out of 6, and the rewritten one scores 6 out of 6. What is worth remembering is not the number, but that each ✗ matches one question that Phúc had to ask back in the earlier section. If you like to have a frame to fill in, here is question-template.txt:
Hi ..., I'm stuck on ..., could you take a quick look?
I'm working on ... (what, to reach which goal).
I expected ..., but actually ...:
(paste the error or the result verbatim, as text, not a screenshot)
I tried:
- ... (result: ...)
- ... (result: ...)
Environment: (operating system, version of Node or the tool, commit or branch).
I suspect ... because ... (if you have a hypothesis). My question: (ONE specific question)?Run the script on the empty template itself, and you see something interesting:
node check.ts question-template.txtquestion-template.txt: 4/6 parts
✓ says what you are doing
✗ pastes the error verbatim
✓ says what you expected and what happened
✓ lists at least two things you tried
✗ gives the environment
✓ ends with a questionAn empty frame scores 4 out of 6, because the frame already contains phrases such as "I'm working on", "I expected" and "I tried". It shows the limit of any checker based on keywords: it knows a part is there, not whether the part has content. In the demo repo I keep two tests that record this limit (one for the template, one for a message stuffed with keywords but empty). So use the script as a reminder list, and reread the message with your own eyes as if you were the person who will receive it.
How should you send it so it is less of a bother?
There are a few small habits that I think are worth keeping. Send the whole message at once, do not send "hey" and then wait for the other person to ask "what's up?", because people may see the message while they are busy and leave it until the end of the session. If the answer can help the whole team (like the ENOTFOUND db error that any newcomer can hit), ask in the shared channel instead of a private message, so the next person can find these words. If Phúc is in a meeting or concentrating, you can add a line like "take a look when you are free, I'll work on something else while I wait", since that way the reader does not feel pressure to answer immediately.
There is one more habit that is forgotten most often: when you have the answer, come back and report the result. One line such as "changing it to localhost worked, thank you" tells the other person that their time was useful, and is one reason they will gladly answer next time.
After you get the answer, what next?
Minh does two things. The first is to write it into the end-of-day log: what the error was, what the cause was, and how long I spent before asking, to learn from it for the time limit above. The second is to turn the whole of that afternoon into a few minutes for the next person, with a small pull request that adds one line to the README about the ENOTFOUND db error: when you run the tests outside Docker, change the host in .env.test to localhost. This is also the kind of first contribution a newcomer can make, because a newcomer is the one who sees most clearly where the documentation is missing.
The limits of this post, and the tests
I wrote seven tests for the checker: the bad message passes no part, the good message passes all six, removing the verbatim error line loses exactly that part, naming only one thing tried is not enough, an error written inside a sentence does not count as pasted verbatim, and two tests that record the limits mentioned above. They run with the test runner that ships with Node:
node --test src/check-question.test.ts# tests 7
# pass 7
# fail 0I should also say that these six parts are something I came up with from general guides, not a standard. Every team has its own culture: some prefer a short call, others require every question to go in the shared channel. Ask your own Phúc which style they prefer; that is also a good question to ask in your first week.
How do you know whether you are doing well?
From that day Minh asked earlier and more clearly, and small errors no longer swallowed a whole afternoon. But something else started to worry Minh: apart from the times of being stuck, Minh did not know whether they were doing well. Nobody said anything, and Minh could not tell whether silence meant everything was fine or that there was a problem. How to ask for feedback from people who are further ahead is the subject of the next posts.
You can follow the whole journey in the series A junior's journey. If you want more practice, the question tell me about yourself in one minute and the others are in the interview question bank.