Explain JS threading and useState vs useRef
Company: OpenAI
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: hard
Interview Round: HR Screen
Quick Answer: This question evaluates understanding of JavaScript's execution model and concurrency mechanisms (including worker-based threading) along with React state-management semantics, specifically the behavioral differences between useState and useRef.