Question
Which statement about BlockingQueue and Producer-Consumer is the strongest interview answer?
- BlockingQueue and Producer-Consumer is mostly a naming style choice and has little effect on runtime or design.
- A BlockingQueue coordinates producers and consumers by allowing threads to wait when the queue is empty or full.
- BlockingQueue and Producer-Consumer exists mainly to reduce the number of Java files in a project.
- BlockingQueue and Producer-Consumer matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind BlockingQueue and Producer-Consumer.
Answer and rationale
Correct answer: B. A BlockingQueue coordinates producers and consumers by allowing threads to wait when the queue is empty or full.
A BlockingQueue coordinates producers and consumers by allowing threads to wait when the queue is empty or full. This is the base concept interviewers commonly test first.
Track: Java