Systematic Debugging and Root Cause Analysis Questions
Methodically diagnosing failures and identifying their true cause. Covers hypothesis-driven debugging, bisection and instrumentation, full-stack and production diagnosis, debugging under pressure, and root-cause analysis that prevents recurrence. Emphasizes a repeatable process over guesswork.
Walk me through how you'd use Chrome DevTools to figure out why a function is being called with an unexpected argument, using breakpoints instead of adding console.log statements.
Here's a component meant to increment a counter once per second, but it always shows 1 no matter how long you wait:
function Counter() {
const [count, setCount] = useState(0);
useEffect(() => {
const id = setInterval(() => {
setCount(count + 1);
}, 1000);
return () => clearInterval(id);
}, []);
return <div>{count}</div>;
}
What's going wrong, and how would you fix it?
A user's error tracker shows a JS exception in production with a stack trace full of single-letter variable names and file names like main.a3f1.js. How do you get from that to the actual bug?
You ship a bug fix, but for the next hour some users are still hitting the broken version even after refreshing the page. What's likely happening and how would you confirm it?
In modern JavaScript (ES6+), examine the following code and explain why each button logs the same index when clicked. Provide at least two different fixes so that each button logs its own index.
for (var i = 0; i < 3; i++) {
var btn = document.createElement('button');
btn.textContent = 'Button ' + i;
btn.onclick = function() { console.log('clicked', i); };
document.body.appendChild(btn);
}
Explain the root cause and fixes.
Unlock Full Question Bank
Get access to all 10 Systematic Debugging and Root Cause Analysis interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.