System Design · Middle · Question 63 of 75
When should heavy computation move to a Web Worker?
- ✓Correct answer: When it would block the main thread long enough to freeze input or animations (parsing large files, image processing)
- 2Always, for every function
- 3Never - workers are slower
Explanation
Workers run in parallel but can't touch the DOM; data is passed via messages (or transferable objects).