r/HackerEarthCommunity • u/Neil_at_HackerEarth • 2h ago
The interviewer asks you to debug code you've never seen before. What's your first move?
Imagine you're in a technical interview.
The interviewer shares a piece of code with you. It has a bug, but there's no explanation of what the code is supposed to do.
You have to figure it out.
What would you do first?
- Read the entire code before touching anything.
- Ask what the expected output should be.
- Run through a sample input manually.
- Start checking for obvious errors.
Ask questions about the requirements. There's no single perfect answer here. But I'm interested in how developers approach unfamiliar code under pressure.
What's your debugging process when you don't know where the problem is?
1
u/Realistic-Team8256 2h ago
keep breakpoints and launch the debugger