Available question text
Coordinate five concurrent threads arranged in a ring that must each acquire two adjacent shared resources (forks) before calling the provided eat callback, ensuring mutual exclusion and a discipline that avoids deadlock and starvation. Implement wantsToEat(philosopher, pickLeftFork, pickRightFork, eat, putLeftFork, putRightFork) to safely pick both forks, eat, and release them.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1226. The Dining Philosophers
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source