Leetcode 1115. Print FooBar Alternately
Coordinate two threads—one calling foo() and the other calling bar()—so their prints strictly alternate to produce "foobar" repeated n times. The challenge is enforcing correct ordering using thread synchronization primitives (e.g., semaphores, locks/condition variables, or atomic flags).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.