Coding, Development & IT Security Difficulty: Intermediate
Software Engineering Mentor: Bug Identification and Resolution Challenge
This prompt directs an experienced software engineering mentor to provide a code snippet containing a subtle bug, challenge coders to identify and fix the bug, and require them to explain the nature of the bug, its impact on program functionality, and the rationale behind their fix. It is designed to enhance problem-solving abilities and attention to detail in coding. Users must supply the programming language and optionally the difficulty level or topic for the code snippet. The output includes the buggy code snippet, the challenge instructions, and a structured framework for responses.
Act as a professional Software Engineering Mentor with expertise in debugging and code review. Based on the provided [PROGRAMMING LANGUAGE], placeholder and optional [DIFFICULTY LEVEL], placeholder or [TOPIC], placeholder, create a code snippet that contains a subtle bug. Present the snippet along with a challenge that instructs coders to identify and fix the bug. Require them to explain the bug’s nature, how it affects the program’s functionality, and the reasoning behind their solution. Structure the output to include the buggy code, the challenge prompt, and a clear framework guiding coders on how to respond. Deliver the results as a comprehensive exercise designed to sharpen problem-solving skills and attention to detail in coding.
Highlighted text is a blank. Swap it for your own detail before you send the prompt.
What it produces
- Provide a Python function that calculates factorial but contains an off-by-one error.
- Challenge coders to find the off-by-one bug, explain how it causes incorrect results, and fix it by adjusting the loop boundaries.
- Require coders to submit their explanation and corrected code snippet.
How to use this prompt
Four steps, about a minute. Nothing to install and no account needed.
Copy the prompt
Use the Copy button above. The whole prompt goes to your clipboard exactly as written. Nothing is trimmed.
Fill in the blanks
Replace [PROGRAMMING LANGUAGE] [DIFFICULTY LEVEL] [TOPIC] with your own details. Everything in square brackets is a blank for you to fill in.
Paste it into your assistant
Checked against ChatGPT, Claude, Gemini. It is written as plain instructions, so paste it into whichever of them you already use.
Read the result, then push back
Compare what you get to the example below. If it is close but not right, say what to change: shorter, warmer, more specific, then ask again in the same conversation.
More prompts like this one
Close neighbours in Coding, Development & IT Security, by shared subject and tagging.
- Best Practices for Refactoring Provided Code Snippet
- Optimize Code Review Process to Enhance Constructive Feedback and Team Collaboration
- Create a Comprehensive Onboarding Plan for New Team Members to Understand a Codebase
- Systematic Troubleshooting and Resolution of Feature Failures After Code Changes
- Professional Code Review and Improvement Recommendations
- Software Engineer Code Performance Optimization Plan
Reviews and questions
What other people got out of this prompt, and what they asked about it.
Sign in to review this prompt.
Sign In to ReviewNo reviews yet
Be the first to share how this prompt worked for you.
Ask how to customize, adapt, or use this prompt more effectively.
Sign In to AskNo questions yet
Have a question about using or customizing this prompt? Be the first to ask.