Implement a Thread-Safe Blocking Queue

Problem

Implement a bounded blocking queue for multiple producers/consumers (Databricks has a dedicated concurrency round).

Example

put() blocks when full; take() blocks when empty; no busy-wait

Constraints

  • Correct under high concurrency

What Databricks looks for

Correctness over cleverness — a simple, reasoned synchronized solution beats a fragile lock-free one. Discuss condition variables and spurious wakeups.

added …
LeaderboardSalaryAccount