Texas Instruments Interview Question

Application question of using semaphore