Your question is Design a Bounded Queue for Multithreading. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Design Bounded Queue such that it functions in multithreaded environment ?
Asked in the LLD and Concurrency stage. Explain the queue API, synchronization strategy, blocking behavior, shutdown semantics, and how the design could support a producer-consumer path in an ML inference service.
Address the following:
Assume bounded memory is required and that multiple producers and consumers may operate concurrently.