The Weird Old Trick That Still Works
There's a classic programmer trick called rubber duck debugging. The idea is simple: you explain your problem out loud to a rubber duck sitting on your desk. The act of explaining forces your brain to slow down, organize your thoughts, and often — before the duck says a single word — you figure out the answer yourself.
I heard about this for the first time when I was maybe three weeks into learning to code. My mentor mentioned it offhand and I thought he was joking. He was not. And it works. It's annoying how much it works.
But here's the thing: a rubber duck doesn't talk back. An AI does. And that changes the technique in a really powerful way — especially for beginners who aren't always sure if what they think they understand is actually correct.
So what I want to walk you through today is how to use the rubber duck technique with an AI — not just to find answers, but to unstick your thinking, check your understanding, and actually learn something instead of just copying a fix and moving on.
Why Beginners Get Stuck Differently
When you're new, you don't just get stuck on problems. You get stuck on what the problem even is. You're not sure if you're confused about the concept, the syntax, the tool, or whether you've even approached the right thing entirely.
Classic rubber ducking works when you already have a decent mental model and just need to slow down. But as a beginner, you might not have that model yet. You explain the problem to your duck, and you still have no idea what's going on. The duck stays silent and so does your brain.
That's where AI as your rubber duck changes everything. Because now the duck can ask you questions back. It can poke holes in your explanation. It can say "wait, what do you mean by that?" — and that friction is often exactly what you need.
The Core Prompt Structure
The key to making this work is how you open the conversation. Don't ask for an answer. Ask for help thinking through the problem.
Here's the structure I use:
# Rubber Duck Prompt Template
I'm going to explain a problem I'm stuck on.
Please don't give me the answer yet.
Instead, ask me questions that help me think
through what I actually understand and
where my thinking might be breaking down.
Here's what I'm working on: [describe it]
Here's what I think is happening: [your theory]
Here's where I'm confused: [be specific]That last line — "please don't give me the answer yet" — is doing a lot of heavy lifting. By default, AI wants to help by solving. You're redirecting it to help you think instead.
The "No Answer Yet" Rule
If the AI jumps straight to a solution anyway, just reply: "Thanks — but can we back up? I want to understand this first. What questions should I be asking myself here?" That usually gets it back on track.
A Real Example of This in Action
When I first tried this, I was confused about why a function I'd written wasn't returning the value I expected. I had stared at it for twenty minutes and could not see what was wrong. My brain was looping.
Instead of pasting the code and asking "what's wrong here?", I tried the rubber duck approach:
I'm going to explain a problem I'm stuck on.
Please don't give me the answer yet —
ask me questions instead.
I wrote a function that's supposed to
return a number, but when I print the
result it shows 'undefined'. I think
the function is running because I can
see a console.log inside it firing.
I'm confused about why it returns
undefined if the function is running.The AI came back with something like: "Interesting. When you say the function is returning undefined — does your function have a return statement? And if it does, where is it located relative to the console.log you mentioned?"
And that was it. I immediately went and looked at my return statement. It was inside an if block that was never true. I'd been staring at the wrong part of the code for twenty minutes. The question sent me to the right place in two seconds.
That's the magic. The AI didn't tell me the answer. It asked me the question that made me see it myself.
Three Variations Worth Knowing
The basic rubber duck prompt is a great starting point, but here are three variations I keep coming back to depending on what kind of stuck I am:
The Concept Check: When I think I understand something but I'm not totally sure, I explain it back to the AI in my own words and ask it to identify where my understanding breaks down — not to correct me, but to ask me questions that expose the gaps. This is incredibly useful for things like closures, async/await, or any concept that seems clear until you try to explain it.
I'm going to explain [concept] in my own words.
Don't correct me yet — just ask me questions
that reveal where my understanding
might have holes.
Here's my explanation: [your explanation]The Plan Check: Before I start building or writing something, I'll explain my plan and ask the AI to ask me questions about things I might not have thought through. This catches problems before they become bugs.
The Post-Mortem: After I've fixed something, I explain what I did and why I think it worked. Then I ask the AI if my reasoning is correct. Sometimes I fixed the right thing for the wrong reason, and that's worth knowing.
Know When to Ask for the Answer
This technique isn't about refusing help forever. If you've genuinely worked through it and still can't see the problem, just say: "Okay, I've thought it through and I'm still stuck — can you show me now?" The goal is understanding, not suffering.
The Habit That Actually Makes You Better
Here's the honest reason I think this technique matters more than most prompting advice for beginners: it slows you down at exactly the right moment.
One of the biggest traps when you're new to AI tools is that you can get answers so fast that you never actually build understanding. You paste an error, get a fix, paste the fix, it works, move on. Repeat a hundred times. And you're still a beginner six months later because you've been copying, not learning.
The rubber duck prompt breaks that loop. It forces you to articulate what you think you know. It makes the confusion concrete instead of vague. And it gives the AI a way to be actually useful — not as an answer machine, but as a thinking partner.
I still use this all the time. Not for every single problem — sometimes I just need a quick answer and that's fine. But when I notice I'm going in circles, or when something feels fuzzy even after I "get" it, rubber ducking with an AI is almost always the fastest way out.
Try it the next time you're stuck. Explain what's going on, tell the AI not to solve it yet, and see what questions come back. You might solve it yourself before it even finishes responding. That's the point.
More tutorials in this category, or explore the full field guide.