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.
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.
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?
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?
Describe a practical method to correlate a customer's frontend performance complaint (slow page loads) with backend traces and metrics. Include required browser instrumentation (RUM), header propagation for correlation IDs, span naming conventions, sampling strategies, and how to map measured frontend spans to backend services for root-cause analysis.
A page feels janky when a user resizes a panel that triggers a lot of DOM reads and writes in a loop. How would you confirm it's layout thrashing and not just slow JavaScript?
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.