- How do you reproduce a bug that only happens intermittently or for certain users?
- Start by gathering exact conditions: browser version, operating system, user permissions, data state, time of occurrence, and sequence of actions. Check server logs for timestamps matching the incident. Intermittent bugs often stem from race conditions, cached data, session state, or environment-specific configurations. Reproduce locally by replicating those conditions as closely as possible, sometimes requiring production database snapshots or specific timing sequences.
- What's the difference between a hotfix and a regular bug fix?
- A hotfix addresses a critical bug in production that requires immediate deployment, bypassing normal release cycles. It typically goes straight to the main branch with minimal testing because the severity outweighs the risk. Regular bug fixes follow standard development workflow: branch creation, peer review, automated testing, staging deployment, then scheduled production release alongside other changes.
- When is a bug actually a feature request in disguise?
- If the software behaves exactly as originally specified but users expect different behaviour, that's a feature request. The distinction matters because bug fixes aim to restore intended functionality, while feature requests introduce new behaviour requiring design decisions, broader testing, and potentially different prioritisation. A calculation producing wrong results is a bug; a calculation that's correct but users want additional options is a feature.
- Why might fixing one bug cause another to appear elsewhere?
- Code often has implicit dependencies where one part relies on another's specific behaviour, even buggy behaviour. Fixing a function that incorrectly returned null might break code that explicitly checked for null as a signal. Shared state, global variables, or tightly coupled modules mean changes ripple outward. Regression testing catches these, but unanticipated dependencies in poorly documented systems sometimes only surface after deployment.
- What information should a proper bug report contain to be actionable?
- Expected versus actual behaviour, exact steps to reproduce, environment details (browser, OS, software version), relevant error messages or codes, screenshots or screen recordings if applicable, and data that triggers the issue. Vague reports like "the page doesn't work" require extensive back-and-forth. Specific reports with reproduction steps let someone begin diagnosis immediately, often cutting resolution time by half or more.
- How do you determine whether a bug should be fixed or the code should be rewritten?
- Consider the scope of the problem and the code's condition. If the bug is isolated and the surrounding code is maintainable, fix it directly. If you find multiple related bugs, tangled logic, or code that's difficult to understand and modify safely, rewriting that section may be more reliable long-term. Time constraints and risk tolerance also factor in—rewrites take longer but reduce future maintenance burden.