React debugging exercise
One key press adds several notes
A keyboard shortcut on a notes board adds more notes the longer the board is open, and keeps working after it is switched off. Find out why and make it fire once.
What you’ll practice: useEffect, event listeners, keyboard shortcuts
Bug report
On the team notes board, pressing N adds a note without leaving the keyboard. People report that one press often adds two or more notes, and that it gets worse the longer the board is open.
Some have switched keyboard shortcuts off in the header, and notes kept appearing when they pressed N.
Reproduce the issue, identify the cause, and make the smallest reliable fix. The shortcut must keep working, and must not fire while someone is typing in the note field.
Be ready to explain why one press adds several notes and how you verified your change.
Practice this scenario
After you finish your fix, you can review a proposed fix for the same bug.
No account needed. Your attempts, code and answers stay in this browser. How storage works (opens in a new tab)
Practice on a computer
The code editor needs a bigger screen. Get this page’s link by email, and open it on your computer.
How it works
- 1
Reproduce and fix
Each scenario is a small app with one real bug. Reproduce it in the live preview, find the cause, and make the smallest fix. Five checks confirm the behavior.
- 2
Explain your reasoning
Answer four short questions: what caused it, what you changed, what you ruled out, and how you verified it.
- 3
Review another fix
Judge a proposed fix for the same bug, approve it or request changes, then see how the checks treat it.