Debugging: Finding out why code isn't working and fixing it, by reading errors, adding logs, using breakpoints, and checking your assumptions one by one.
Example
Orders are saving without a delivery address. You put a breakpoint in the save function and see that the address is already empty when it arrives. Working backwards, you find the form sends the field under a different name.
A Simple Debugging Approach
- Reproduce the problem reliably. Note the exact steps and input.
- Read the error message and stack trace fully. The first line of your own code in the trace is usually the place to start.
- Form a guess, such as "the value is null before it reaches here".
- Check it with a breakpoint, a log line, or a small test.
- Narrow it down until you find the exact line, then fix it.
- Confirm the fix and add a test so it doesn't come back.
Debugging Tools
| Tool | What it helps with |
|---|---|
| Breakpoints in your IDE | Pause the program and inspect variables step by step |
| Logging | See what happened in environments where you can't pause |
| Browser developer tools | Inspect network calls, console errors, and page elements |
| API tools such as Postman | Test a backend call on its own, without the screen |
One of my favourite interview questions was "Tell me about a bug you found hard to fix." The best answers weren't about clever code. They were about a calm process: reproduce, read the error, test one guess at a time.
From the interview roomDhaivat Ajwaliya, 16+ years interviewing interns
When to Ask for Help
Try on your own first, but don't stay stuck for a whole day. A good rule for interns: after 30 to 60 minutes without progress, ask. Share what you expected, what happened, what you tried, and the error. That makes it easy for someone to help, and shows you did your part. See blocker.
Related terms
- Exception: a runtime error you often debug.
- Logging: messages that help you debug later.
- IDE: where breakpoints and step-through debugging live.
- Bug: the problem you are debugging.
- Blocker: what a long debugging session can become if you don't ask for help.
Previous term: Deadline | Next term: Defect
Related guides
- What to Do in Your First Week of an IT Internship
- Technical Interview Questions for Freshers
- Common IT Internship Mistakes
Frequently asked questions
What is debugging in simple words?
Debugging is finding out why a program isn't working as expected and fixing the cause.
What are the steps of debugging?
Reproduce the problem, read the error, form a guess, check it with breakpoints or logs, narrow it down, fix it, and add a test.
How long should an intern try before asking for help?
Usually 30 to 60 minutes without progress. Then ask, sharing what you tried and the exact error.
How do I answer debugging questions in interviews?
Describe a real bug, the steps you took to find it, the cause, the fix, and what you learned.
Explore more internship terms
The IT Internship Glossary explains 199 terms you will hear before and during your internship, with simple definitions and real examples.
Browse all 199 terms