Logo

Question preview

Signal vs Broadcast

What this preview is

About this preview

Signal vs Broadcast is a cooked quant interview question on operating systems.

Unlock full access to getcracked

Join to unlock this question, detailed solutions, and our complete library of quant finance interview prep.

Understanding condition variable signalling in concurrent programming

This question tests your grasp of thread synchronization primitives, specifically the distinction between two fundamental operations on POSIX condition variables. It's a foundational concept in operating systems and concurrent systems design, frequently asked at firms that build latency-sensitive infrastructure or work heavily with multithreaded codebases.

The question asks you to articulate the behavioural difference between two closely-named functions and understand when each is appropriate. This matters because choosing the wrong primitive can lead to subtle deadlocks, spurious wakeups, or inefficient thread scheduling. A solid answer requires you to reason about thread wake-up semantics, the relationship between condition variables and locks, and the cost-benefit trade-offs of each approach in different scenarios.

  • Condition variables and their role in producer-consumer patterns
  • Lock ownership and the notify-wait contract
  • Thundering herd problem and selective wake-up
  • Correctness under spurious wakeups

Related learning resources

  • Operating Systems: Three Easy Pieces